commit
5c96a28c05
4 changed files with 15 additions and 6 deletions
|
|
@ -40,7 +40,7 @@ def login():
|
|||
tenant_id = r.pop("tenantId")
|
||||
# change this in open-source
|
||||
r["limits"] = {
|
||||
"teamMember": -1,
|
||||
"teamMember": int(environ.get("numberOfSeats", 0)),
|
||||
"projects": -1,
|
||||
"metadata": metadata.get_remaining_metadata_with_count(tenant_id)}
|
||||
|
||||
|
|
@ -64,7 +64,7 @@ def get_account(context):
|
|||
'data': {
|
||||
**r,
|
||||
"limits": {
|
||||
"teamMember": -1,
|
||||
"teamMember": int(environ.get("numberOfSeats", 0)),
|
||||
"projects": -1,
|
||||
"metadata": metadata.get_remaining_metadata_with_count(context['tenantId'])
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from chalicelib.utils.helper import environ
|
||||
from chalicelib.utils import pg_client
|
||||
from chalicelib.core import unlock
|
||||
|
||||
|
|
@ -14,7 +15,8 @@ def get_status(tenant_id):
|
|||
"edition": r.get("edition", "").upper(),
|
||||
"versionNumber": r.get("version_number", ""),
|
||||
"license": license[0:2] + "*" * (len(license) - 4) + license[-2:],
|
||||
"expirationDate": unlock.get_expiration_date()
|
||||
"expirationDate": unlock.get_expiration_date(),
|
||||
"teamMember": int(environ.get("numberOfSeats", 0))
|
||||
},
|
||||
"count": {
|
||||
"teamMember": r.get("t_users"),
|
||||
|
|
|
|||
|
|
@ -13,9 +13,14 @@ def get_license():
|
|||
|
||||
|
||||
def check():
|
||||
license=get_license()
|
||||
license = get_license()
|
||||
if license is None or len(license) == 0:
|
||||
print("!! license key not found, please provide a LICENSE_KEY env var")
|
||||
environ["expiration"] = "-1"
|
||||
environ["numberOfSeats"] = "0"
|
||||
return
|
||||
print(f"validating: {license}")
|
||||
r = requests.post('https://parrot.asayer.io/os/license', json={"mid": __get_mid(), "license": get_license()})
|
||||
r = requests.post('https://api.openreplay.com/os/license', json={"mid": __get_mid(), "license": get_license()})
|
||||
if r.status_code != 200 or "errors" in r.json() or not r.json()["data"].get("valid"):
|
||||
print("license validation failed")
|
||||
print(r.text)
|
||||
|
|
@ -23,6 +28,8 @@ def check():
|
|||
else:
|
||||
environ["expiration"] = str(r.json()["data"].get("expiration"))
|
||||
environ["lastCheck"] = str(TimeUTC.now())
|
||||
if r.json()["data"].get("numberOfSeats") is not None:
|
||||
environ["numberOfSeats"] = str(r.json()["data"]["numberOfSeats"])
|
||||
|
||||
|
||||
def get_expiration_date():
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ SAML2 = {
|
|||
}
|
||||
idp = None
|
||||
# SAML2 config handler
|
||||
if len(environ.get("SAML2_MD_URL")) > 0:
|
||||
if len(environ.get("SAML2_MD_URL","")) > 0:
|
||||
print("SAML2_MD_URL provided, getting IdP metadata config")
|
||||
from onelogin.saml2.idp_metadata_parser import OneLogin_Saml2_IdPMetadataParser
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue