Skip to content
Snippets Groups Projects
Commit 2781f336 authored by Bjarke Madsen's avatar Bjarke Madsen
Browse files

Add authlib and flask-login libraries for oauth integration

parent 980ff6cf
Branches
Tags
1 merge request!44Feature/comp 208 google o auth poc
import json import json
import jsonschema import jsonschema
CONFIG_SCHEMA = { CONFIG_SCHEMA = {
'$schema': 'http://json-schema.org/draft-07/schema#', '$schema': 'http://json-schema.org/draft-07/schema#',
'type': 'object', 'type': 'object',
'properties': { 'properties': {
'SQLALCHEMY_DATABASE_URI': {'type': 'string', 'format': 'database-uri'}, 'SQLALCHEMY_DATABASE_URI': {'type': 'string', 'format': 'database-uri'},
'SURVEY_DATABASE_URI': {'type': 'string', 'format': 'database-uri'} 'SURVEY_DATABASE_URI': {'type': 'string', 'format': 'database-uri'},
'oidc': {
'type': 'object',
'properties': {
'client_id': {'type': 'string'},
'client_secret': {'type': 'string'},
'server_metadata_url': {'type': 'string', 'format': 'uri', 'pattern': '^https?://'},
},
'required': ['client_id', 'client_secret', 'server_metadata_url'],
'additionalProperties': False
},
'SECRET_KEY': {'type': 'string'},
}, },
'required': ['SQLALCHEMY_DATABASE_URI', 'SURVEY_DATABASE_URI'], 'required': ['SQLALCHEMY_DATABASE_URI', 'SURVEY_DATABASE_URI', 'SECRET_KEY'],
'additionalProperties': False 'additionalProperties': False
} }
......
{ {
"SQLALCHEMY_DATABASE_URI": "postgresql://compendium:compendium321@localhost:65000/compendium", "SQLALCHEMY_DATABASE_URI": "postgresql://compendium:compendium321@localhost:65000/compendium",
"SURVEY_DATABASE_URI": "" "SURVEY_DATABASE_URI": "",
"oidc": {
"client_id": "<id>",
"client_secret": "<secret>",
"server_metadata_url": "https://accounts.google.com/.well-known/openid-configuration"
},
"SECRET_KEY": "changeme"
} }
...@@ -8,6 +8,8 @@ flask-sqlalchemy~=3.0 ...@@ -8,6 +8,8 @@ flask-sqlalchemy~=3.0
openpyxl~=3.1 openpyxl~=3.1
psycopg2-binary~=2.9 psycopg2-binary~=2.9
SQLAlchemy~=2.0 SQLAlchemy~=2.0
authlib~=1.2
flask-login~=0.6
pytest~=7.2 pytest~=7.2
pytest-mock~=3.10 pytest-mock~=3.10
......
...@@ -20,7 +20,9 @@ setup( ...@@ -20,7 +20,9 @@ setup(
'openpyxl~=3.1', 'openpyxl~=3.1',
'psycopg2-binary~=2.9', 'psycopg2-binary~=2.9',
'SQLAlchemy~=2.0', 'SQLAlchemy~=2.0',
'sentry-sdk[flask]~=1.23' 'sentry-sdk[flask]~=1.23',
'authlib~=1.2',
'flask-login~=0.6'
], ],
include_package_data=True, include_package_data=True,
......
...@@ -17,7 +17,8 @@ def _test_data_csv(filename): ...@@ -17,7 +17,8 @@ def _test_data_csv(filename):
def dummy_config(): def dummy_config():
yield { yield {
'SQLALCHEMY_DATABASE_URI': 'sqlite://', 'SQLALCHEMY_DATABASE_URI': 'sqlite://',
'SURVEY_DATABASE_URI': 'sqlite:///' 'SURVEY_DATABASE_URI': 'sqlite:///',
'SECRET_KEY': 'testsecret123'
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment