Skip to content

Commit

Permalink
Use OPENID_URL and OPENID_URL [patch] (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
ric-evans authored Sep 1, 2023
1 parent 0a2444b commit e83181f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
5 changes: 2 additions & 3 deletions rest_server/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ async def start(debug: bool = False) -> RestServer:
args = RestHandlerSetup( # type: ignore[no-untyped-call]
{
"auth": {
"secret": ENV.MOU_AUTH_SECRET,
"issuer": ENV.MOU_AUTH_ISSUER,
"algorithm": ENV.MOU_AUTH_ALGORITHM,
"openid_url": ENV.OPENID_URL,
"audience": ENV.OPENID_AUDIENCE,
},
"debug": debug,
}
Expand Down
11 changes: 7 additions & 4 deletions rest_server/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,24 @@
# --------------------------------------------------------------------------------------
# Constants

# pylint:disable=invalid-name


@dc.dataclass(frozen=True)
class EnvConfig:
"""Environment variables."""

# pylint:disable=invalid-name
MOU_AUTH_ALGORITHM: str = "HS512" # 'RS256',
MOU_AUTH_ISSUER: str = "http://localhost:8888" # 'MOUdash',
MOU_AUTH_SECRET: str = "secret"
OPENID_URL: str = "http://localhost:8888"
OPENID_AUDIENCE: str = "mou"

MOU_MONGODB_AUTH_USER: str = "" # None means required to specify
MOU_MONGODB_AUTH_PASS: str = "" # empty means no authentication required
MOU_MONGODB_HOST: str = "localhost"
MOU_MONGODB_PORT: int = 27017

MOU_REST_HOST: str = "localhost"
MOU_REST_PORT: int = 8080

CI_TEST: bool = False


Expand Down

0 comments on commit e83181f

Please sign in to comment.