Public Repository

Last pushed: 3 months ago
Short Description
United Effects License service as part of UE-Authg
Full Description

UE-License_Srvc

This micro-service allows users to purchase a license to use a particular product and domain. The service allows for purchase, payment (via stripe) and validation of licenses.

This repository is intended to be open source and will be made public when operational.

Usage

This micro-service is standalone and can be utilized in any number of micro-service architectures. It is provided as part of the United Effects Platform and is primarily designed to operate with UE technologies.

Auth Types

  • Bearer Authentication = (B)
  • Basic + Code Authentication = (BC)
  • Stripe Payment Token Required = (P)
  • Webhook authentication = (W) - Utilizes a secret token defined in the config
  • Admin or Owner Only (AO)
  • Admin only (A)

NOTE A and O are restrictions that still need to be coded

EndPoints - License Domain

  • POST (BC) /license - register a new license with default active to false
  • GET (B)(A) /license - get all licenses
  • GET (B)(A) /licensetime - get all time remaining on each license (redundant but readable)
  • GET (B)(AO) /license/id - retrieve an existing license
  • PATCH (B)(AO) /license/id - modify a license in any way
  • DELETE (B)(A) /license/id - sets a license to inactive and immediately cancels all associated subscriptions
  • GET (BC) /license/id/validate - Similar to GET /license/id except that it simply verifies if the license is valid and only returns active
  • PUT (B)(AO) /license/lid/subscription/sid/cancel - Allows a user to cancel a specific subscription associated to a license at the end of its billing period
  • DELETE (B)(A) /license/id/subscription/sub - Allows a user to set a license to inactive and remove an associated subscription from the license
  • PUT (B)(AO) /license/id/changeplan - Allows a license (and its associated sub) to be up or down graded

EndPoints - Stripe Domain

  • POST (P) /stripe/creditcard - Process stripe payment and update license (takes a query parameter 'License' = to lic ID)
  • POST (W) /stripe/connect - This is a webhook endpoint to allow stripe to sync its events with UE-Auth
  • GET (B)(A) /stripe/customer/:sid - Get customer information from stripe
  • DELETE (B)(A) /stripe/sub/license/id - Remove a single subscription from a license
  • POST (B)(A) /stripe/charge/customer/id/license/lid - Ability to charge the owner of a license (customer id) any amount using body {amount: ####}. Amount needs to be in cents
  • POST (B)(A) /stripe/charge/customer/id - Ability to charge any customer ID with an amount in cents. Amount sent in body.
  • POST (B)(A) /stripe/secret - Ability to set the Stripe API secrets and webhook code
  • GET (B)(A) /stripe/secret - Ability to get the Stripe API secrets currently in use
  • GET (B)(A) /stripe/secrets/history - Ability to get all secrets ever set in the system

Metrics

  • GET /health - returns a healthcheck on the service

Payment Dependencies

License Creation Flow

  1. POST /license
  2. Generate a license with active=false --> on error return
  3. Process Stripe Payment with token (license id should be passed to the endpoint using a query parameter from the checkout form)--> on error return
  4. Update license with stripe customer and subscription information and set to active=true --> on error return message with license code and stripe info so it can be presented to CS

MIT License

UnitedEffects License Service (UE-License_Srvc) is a product operated and owned by theBoEffect LLC

Copyright (c) 2017 theBoEffect LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Docker Pull Command
Owner
unitedeffects

Comments (0)