72 lines
2.4 KiB
Python
72 lines
2.4 KiB
Python
import datetime
|
|
|
|
|
|
class ApiStatic:
|
|
PLACEHOLDER = "https://s.tmimgcdn.com/scr/800x500/276800/building-home-nature-logo-vector-template-3_276851-original.jpg"
|
|
FORGOT_LINK = "https://www.evyos.com.tr/password/create?tokenUrl="
|
|
BLACKLIST_LINK = "https://www.evyos.com.tr/support/unknown-login-notice/"
|
|
APP_DIR = "/home/berkay/git-evyos/api-managment-backend/"
|
|
|
|
@classmethod
|
|
def forgot_link(cls, forgot_key):
|
|
return cls.FORGOT_LINK + forgot_key
|
|
|
|
@classmethod
|
|
def blacklist_login(cls, record_id):
|
|
return cls.BLACKLIST_LINK + record_id
|
|
|
|
|
|
class Auth:
|
|
ACCESS_EMAIL_EXT = "evyos.com.tr"
|
|
ACCESS_TOKEN_TAG = "evyos-session-key"
|
|
REFRESHER_TOKEN_TAG = "eys-session-refresher"
|
|
SECRET_KEY_72 = (
|
|
"t3sUAmjTGeTgDc6dAUrB41u2SNg0ZHzj4HTjem95y3fRH1nZXOHIBj163kib6iLybT0gLaxq"
|
|
)
|
|
SECRET_KEY_96 = "7ct8VpiwaP1hR2bVSet4dEEAgepuTZUOnO1QxOgKyDqBR2PkqNhcubSrbUUigQKoQA1PBoeeQn5ZCo24pESmVtKs76nA4EKq"
|
|
SECRET_KEY_144 = (
|
|
"R2p5Rq6KCr6PCfjFYUeH1keF2VWHFEuqINVjBGGnvRA2m10pYUKqfOtIGBcaj2v5wZmElDndzSHGOS7roQsoTelPSok0"
|
|
+ "qqMucurMWE0FGexGpFuJkfPEm9tH2OjMOqegvEetpSVywH0W4Kh4"
|
|
)
|
|
|
|
ALGORITHM = "HS256"
|
|
ACCESS_TOKEN_LENGTH: int = 90
|
|
REFRESHER_TOKEN_LENGTH: int = 144
|
|
PASSWORD_EXPIRE_DAY = datetime.timedelta(days=30)
|
|
TOKEN_EXPIRE_MINUTES_1 = datetime.timedelta(minutes=1)
|
|
TOKEN_EXPIRE_MINUTES_15 = datetime.timedelta(minutes=15)
|
|
TOKEN_EXPIRE_MINUTES_30 = datetime.timedelta(minutes=30)
|
|
TOKEN_EXPIRE_DAY_1 = datetime.timedelta(days=1)
|
|
TOKEN_EXPIRE_DAY_5 = datetime.timedelta(days=5)
|
|
TOKEN_EXPIRE_DAY_15 = datetime.timedelta(days=15)
|
|
TOKEN_EXPIRE_DAY_30 = datetime.timedelta(days=30)
|
|
|
|
|
|
class Routers:
|
|
NO_TOKEN_REQUIRES = [
|
|
"/",
|
|
"/metrics",
|
|
"/openapi.json",
|
|
"/docs",
|
|
"/redoc",
|
|
"/auth/login",
|
|
"/favicon.ico",
|
|
"/docs/oauth2-redirect",
|
|
"/authentication/select",
|
|
"/authentication/login",
|
|
"/authentication/logout",
|
|
"/authentication/refresher",
|
|
"/authentication/refresh",
|
|
"/authentication/disconnect",
|
|
"/authentication/create_password",
|
|
"/authentication/reset_password",
|
|
"/authentication/forgot",
|
|
"/authentication/valid",
|
|
]
|
|
NO_EVENT_REQUIRES = [
|
|
"/access/endpoints/available",
|
|
"/access/endpoint/available",
|
|
"/validations/endpoint",
|
|
"/authentication/avatar",
|
|
]
|