Skip to content

Commit 212a82a

Browse files
committed
docs (AS): add DIRAC AS unused methods description
1 parent 7e663e0 commit 212a82a

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/DIRAC/FrameworkSystem/private/authorization/AuthServer.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,16 @@ def __init__(self):
6868
# The authorization server has its own settings, but they are standardized
6969
self.metadata = collectMetadata()
7070
self.metadata.validate()
71-
# args for authlib < 1.0.0: (query_client=self.query_client, save_token=None, metadata=self.metadata)
72-
_AuthorizationServer.__init__(self, scopes_supported=self.metadata["scopes_supported"]) # for authlib >= 1.0.0
73-
self.save_token = lambda x, y: None # Skip original unused authlib method
74-
self.send_signal = lambda *x, **y: None # Skip original unused authlib method
75-
# the main method that will return an access token to the user (this can be a proxy)
71+
# Initialize AuthorizationServer
72+
_AuthorizationServer.__init__(self, scopes_supported=self.metadata["scopes_supported"])
73+
# authlib requires the following methods:
74+
# The following `save_token` method is called when requesting a new access token to save it after it is generated.
75+
# Let's skip this step, because getting tokens and saving them if necessary has already taken place in `generate_token` method.
76+
self.save_token = lambda x, y: None
77+
# Framework integration can re-implement this method to support signal system.
78+
# But in this implementation, this system is not used.
79+
self.send_signal = lambda *x, **y: None
80+
# The main method that will return an access token to the user (this can be a proxy)
7681
self.generate_token = self.generateProxyOrToken
7782
# Register configured grants
7883
self.register_grant(RefreshTokenGrant) # Enable refreshing tokens

0 commit comments

Comments
 (0)