aboutsummaryrefslogtreecommitdiff
path: root/gn3/auth
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-01-20 08:20:28 +0300
committerFrederick Muriuki Muriithi2023-01-20 08:22:54 +0300
commitc843e14249be425e20dcb8cbb6653e49c22298de (patch)
treed27e86ad5ae20427846b1a1deb289e8c643c6570 /gn3/auth
parentf4d6e8bbf66ce4601934c586014868f2ced690ca (diff)
downloadgenenetwork3-c843e14249be425e20dcb8cbb6653e49c22298de.tar.gz
auth: Add development utils/tools
To avoid having to manually rebuild some default data for exploration of concepts while developing the system, add a way to build up the test users and oauth2 clients to use for testing.
Diffstat (limited to 'gn3/auth')
-rw-r--r--gn3/auth/authentication/oauth2/models/oauth2client.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/gn3/auth/authentication/oauth2/models/oauth2client.py b/gn3/auth/authentication/oauth2/models/oauth2client.py
index 2ee7858..efaff54 100644
--- a/gn3/auth/authentication/oauth2/models/oauth2client.py
+++ b/gn3/auth/authentication/oauth2/models/oauth2client.py
@@ -34,7 +34,15 @@ class OAuth2Client(NamedTuple):
@property
def client_type(self) -> str:
- """Return the token endpoint authorisation method."""
+ """
+ Return the token endpoint authorisation method.
+
+ Acceptable client types:
+ * public: Unable to use registered client secrets, e.g. browsers, apps
+ on mobile devices.
+ * confidential: able to securely authenticate with authorisation server
+ e.g. being able to keep their registered client secret safe.
+ """
return self.client_metadata.get("client_type", "public")
def check_endpoint_auth_method(self, method: str, endpoint: str) -> bool: