mirror of
https://github.com/sartography/spiff-arena.git
synced 2025-01-29 10:45:17 +00:00
Getting ./bin/pyl to pass
This commit is contained in:
parent
3361bb0cd2
commit
3cc117dbb6
@ -13,7 +13,7 @@ from apscheduler.schedulers.base import BaseScheduler # type: ignore
|
|||||||
from flask.json.provider import DefaultJSONProvider
|
from flask.json.provider import DefaultJSONProvider
|
||||||
from flask_cors import CORS # type: ignore
|
from flask_cors import CORS # type: ignore
|
||||||
from flask_mail import Mail # type: ignore
|
from flask_mail import Mail # type: ignore
|
||||||
from flask_simple_crypt import SimpleCrypt
|
from flask_simple_crypt import SimpleCrypt # type: ignore
|
||||||
from werkzeug.exceptions import NotFound
|
from werkzeug.exceptions import NotFound
|
||||||
|
|
||||||
import spiffworkflow_backend.load_database_models # noqa: F401
|
import spiffworkflow_backend.load_database_models # noqa: F401
|
||||||
@ -135,9 +135,9 @@ def create_app() -> flask.app.Flask:
|
|||||||
configure_sentry(app)
|
configure_sentry(app)
|
||||||
|
|
||||||
cipher = SimpleCrypt()
|
cipher = SimpleCrypt()
|
||||||
app.config['FSC_EXPANSION_COUNT'] = 2048
|
app.config["FSC_EXPANSION_COUNT"] = 2048
|
||||||
cipher.init_app(app)
|
cipher.init_app(app)
|
||||||
app.config['CIPHER'] = cipher
|
app.config["CIPHER"] = cipher
|
||||||
|
|
||||||
app.before_request(verify_token)
|
app.before_request(verify_token)
|
||||||
app.before_request(AuthorizationService.check_for_permission)
|
app.before_request(AuthorizationService.check_for_permission)
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from flask import current_app
|
from flask import current_app
|
||||||
from flask_simple_crypt import SimpleCrypt
|
|
||||||
|
|
||||||
from spiffworkflow_backend.exceptions.api_error import ApiError
|
from spiffworkflow_backend.exceptions.api_error import ApiError
|
||||||
from spiffworkflow_backend.models.db import db
|
from spiffworkflow_backend.models.db import db
|
||||||
@ -16,13 +15,13 @@ class SecretService:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _encrypt(cls, value: str) -> str:
|
def _encrypt(cls, value: str) -> str:
|
||||||
encrypted_bytes = current_app.config["CIPHER"].encrypt(value)
|
encrypted_bytes: bytes = current_app.config["CIPHER"].encrypt(value)
|
||||||
return encrypted_bytes.decode(cls.CIPHER_ENCODING)
|
return encrypted_bytes.decode(cls.CIPHER_ENCODING)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _decrypt(cls, value: str) -> str:
|
def _decrypt(cls, value: str) -> str:
|
||||||
bytes_to_decrypt = bytes(value, cls.CIPHER_ENCODING)
|
bytes_to_decrypt = bytes(value, cls.CIPHER_ENCODING)
|
||||||
decrypted_bytes = current_app.config["CIPHER"].decrypt(bytes_to_decrypt)
|
decrypted_bytes: bytes = current_app.config["CIPHER"].decrypt(bytes_to_decrypt)
|
||||||
return decrypted_bytes.decode(cls.CIPHER_ENCODING)
|
return decrypted_bytes.decode(cls.CIPHER_ENCODING)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
Loading…
x
Reference in New Issue
Block a user