Skip to content

Commit 2261833

Browse files
authored
Merge pull request #124 from speakeasy-sdks/ms/build-gen-fixes
lint fixes
2 parents ccc6020 + 8a20842 commit 2261833

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/clerk_backend_api/jwks_helpers/authenticaterequest.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ class AuthenticateRequestOptions:
7979
clock_skew_in_ms: int = 5000
8080

8181
def authenticate_request(request: Requestish, options: AuthenticateRequestOptions) -> RequestState:
82+
""" Authenticates the session token. Networkless if the options.jwt_key is provided.
83+
Otherwise, performs a network call to retrieve the JWKS from Clerk's Backend API."""
84+
8285

8386
def __compute_org_permissions(claims: Dict[str, Any]) -> List[str]:
8487
features_str = claims.get("fea")
@@ -98,11 +101,9 @@ def __compute_org_permissions(claims: Dict[str, Any]) -> List[str]:
98101

99102
org_permissions = []
100103

101-
for idx in range(len(mappings)):
104+
for idx, mapping in enumerate(mappings):
102105
if idx >= len(features):
103106
continue
104-
105-
mapping = mappings[idx]
106107
feature_parts = features[idx].split(":")
107108
if len(feature_parts) != 2:
108109
continue
@@ -124,10 +125,6 @@ def __compute_org_permissions(claims: Dict[str, Any]) -> List[str]:
124125

125126
return org_permissions
126127

127-
""" Authenticates the session token. Networkless if the options.jwt_key is provided.
128-
Otherwise, performs a network call to retrieve the JWKS from Clerk's Backend API.
129-
"""
130-
131128
warn('authenticate_request method is applicable in the context of Backend APIs only.')
132129

133130
def get_session_token(request: Requestish) -> Optional[str]:

0 commit comments

Comments
 (0)