Skip to content

Commit 840b985

Browse files
committed
web: Allow CASProvider config to be any source
By defining ``env`` in ``CASProvider``, the superclass implementation of ``is_configured`` requires the variables to be set in the actual environment. Configuration can come from reading in ``/run/secrets``, an ``.env`` file, or the environment. This commit defines our own ``is_configured`` that checks ``CONFIG`` for the needed variables instead of relying on the superclass. Ref: AP-412
1 parent 18a18a6 commit 840b985

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

willa/web/cas_provider.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ def __init__(self) -> None:
6666
'scope': 'openid profile berkeley_edu_groups',
6767
}
6868

69+
def is_configured(self) -> bool:
70+
return all(var in CONFIG for var in self.env)
71+
6972
async def get_token(self, code: str, url: str) -> str:
7073
request = {
7174
'client_id': self.client_id,

0 commit comments

Comments
 (0)