You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: specifications/SPEC_PLATFORM_SERVICE.md
+29-19Lines changed: 29 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,7 @@ The Platform Module shall:
32
32
-**[FR-11]** Download and verify file integrity using CRC32C checksums for run artifacts
33
33
-**[FR-12]** Generate signed URLs for secure Google Cloud Storage access
34
34
-**[FR-13]** Provide user and organization information retrieval with sensitive data masking options
35
+
-**[FR-14]** Support external token providers to bypass internal OAuth 2.0 flows for machine-to-machine, service account, or custom token lifecycle scenarios.
35
36
36
37
### 1.3 Non-Functional Requirements
37
38
@@ -44,7 +45,6 @@ The Platform Module shall:
44
45
### 1.4 Constraints and Limitations
45
46
46
47
- OAuth 2.0 dependency: Requires external Auth0 service for authentication, creating external dependency
-**Factory Pattern**: `Client.get_api_client()` creates configured API clients based on environment settings
90
91
-**Service Layer Pattern**: Business logic encapsulated in service classes with clean separation from API details
91
-
-**Strategy Pattern**: Multiple authentication flows (Authorization Code vs Device Flow) selected based on environment capabilities
92
+
-**Strategy Pattern**: Multiple authentication flows (Authorization Code vs Device Flow) selected based on environment capabilities; external token provider as a fully independent alternative strategy
92
93
-**Template Method Pattern**: Base authentication flow with specific implementations for different OAuth grant types
| JWT Access Token | Token cache/memory | String | Valid JWT with required claims and unexpired |`_authentication.py::get_token()` return value |
114
+
| API Client | Client applications |`_AuthenticatedApi` object | Authenticated and configured for target environment |`_client.py::Client.get_api_client()` factory method |
114
115
| User Information | CLI/Application | UserInfo/Me objects | Complete user and organization data |`_service.py::Service.get_user_info()` method |
115
116
| Health Status | Monitoring systems | Health object | Accurate service and dependency status |`_service.py::Service.health()` method |
116
117
| Downloaded Files | Local filesystem | Binary/structured data | Verified checksums and complete downloads |`_utils.py` download functions and `ApplicationRun`|
@@ -171,7 +172,9 @@ UserInfo:
171
172
172
173
```mermaid
173
174
graph TD
174
-
A[User Request] --> B{Token Cached?}
175
+
A[User Request] --> X{External Token Provider?}
176
+
X -->|Yes| I[Create API Client with External Provider]
177
+
X -->|No| B{Token Cached?}
175
178
B -->|Yes| C[Use Cached Token]
176
179
B -->|No| D[OAuth Authentication]
177
180
@@ -202,7 +205,11 @@ graph TD
202
205
classClient:
203
206
"""Main client for interacting with the Aignostics Platform API."""
0 commit comments