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
- If the user has access to only one subscription, models from that subscription are returned
75
-
- If the user has access to multiple subscriptions, returns `403 Forbidden` with message: "user has access to multiple subscriptions, must specify subscription using X-MaaS-Subscription header"
78
+
#### User Token Authentication (OpenShift/OIDC tokens)
79
+
When using a user token, you have flexible options:
80
+
81
+
**Default (no X-MaaS-Subscription header)**:
82
+
- Returns **all** models from all subscriptions you have access to
83
+
- Models are deduplicated and subscription metadata is attached
76
84
77
-
#### Single Subscription (`X-MaaS-Subscription: <name>`)
78
-
Returns only models accessible via the specified subscription:
79
85
```bash
80
-
curl -H "Authorization: Bearer $TOKEN" \
81
-
-H "X-MaaS-Subscription: premium-subscription" \
86
+
# User with access to "basic" and "premium" subscriptions
87
+
curl -H "Authorization: Bearer $(oc whoami -t)" \
82
88
https://maas.example.com/maas-api/v1/models
89
+
90
+
# Returns models from both subscriptions with subscription metadata
83
91
```
84
92
85
-
#### All Subscriptions (`X-MaaS-Return-All-Models: true`)
86
-
Returns models from all subscriptions the user has access to, with subscription metadata attached. If the user has access to zero subscriptions, returns HTTP 200 with an empty data array (not an error), allowing clients to handle this deterministically:
93
+
**With X-MaaS-Subscription header** (optional):
94
+
- Returns only models from the specified subscription
95
+
- Behaves like an API key request - allows you to scope your query to a specific subscription
96
+
87
97
```bash
88
-
curl -H "Authorization: Bearer $TOKEN" \
89
-
-H "X-MaaS-Return-All-Models: true" \
98
+
# Filter to only "premium" subscription models
99
+
curl -H "Authorization: Bearer $(oc whoami -t)" \
100
+
-H "X-MaaS-Subscription: premium-subscription" \
90
101
https://maas.example.com/maas-api/v1/models
102
+
103
+
# Returns only "premium-subscription" models
91
104
```
92
105
106
+
!!! tip "User token filtering"
107
+
The `X-MaaS-Subscription` header allows user token requests to filter results to a specific subscription. This is useful when you have access to many subscriptions but only want to see models from one.
108
+
93
109
### Subscription Metadata
94
110
95
111
All models in the response include a `subscriptions` array with metadata for each subscription providing access to that model:
@@ -124,16 +140,22 @@ All models in the response include a `subscriptions` array with metadata for eac
124
140
125
141
### Deduplication Behavior
126
142
127
-
When `X-MaaS-Return-All-Models: true` is used, models are deduplicated by `(id, url)` key:
143
+
Modelsare deduplicated by `(id, url, ownedBy)` key:
128
144
129
-
-**Same id + same URL**: Single entry with subscriptions aggregated into the `subscriptions` array
130
-
-**Same id + different URLs**: Separate entries (different model endpoints)
145
+
-**Same id + same URL + same MaaSModelRef (ownedBy)**: Single entry with subscriptions aggregated into the `subscriptions` array
146
+
-**Different id, URL, or MaaSModelRef**: Separate entries
131
147
132
-
**Example:**
133
-
- Model `gpt-3.5` at URL `https://example.com/gpt-3.5` is accessible via subscriptions A and B
- Model `gpt-3.5`from MaaSModelRef `namespace-a/model-a`at URL `https://example.com/gpt-3.5` is accessible via subscriptions A and B
134
150
- Result: One entry with `subscriptions: [{name: "A"}, {name: "B"}]`
135
-
- Model `gpt-3.5` at URL `https://example.com/gpt-3.5-premium` is only in subscription B
136
-
- Result: Separate entry with `subscriptions: [{name: "B"}]`
151
+
- Model `gpt-3.5` from MaaSModelRef `namespace-b/model-b` at the same URL is only in subscription B
152
+
- Result: Separate entry with `subscriptions: [{name: "B"}]` (different MaaSModelRef)
153
+
- Model `gpt-3.5` at URL `https://example.com/gpt-3.5-premium` from `namespace-a/model-a` is only in subscription B
154
+
- Result: Separate entry with `subscriptions: [{name: "B"}]` (different URL)
155
+
156
+
**API key authentication** (single subscription):
157
+
- Deduplication handles edge cases where multiple MaaSModelRef resources point to the same model endpoint
158
+
- Each unique MaaSModelRef resource appears as a separate entry
137
159
138
160
!!! tip "Subscription metadata fields"
139
161
The `displayName` and `description` fields are read from the MaaSSubscription CRD's `spec.displayName` and `spec.description` fields. If these fields are not set in the CRD, they will be empty strings in the response.
When a user belongs to multiple groups that each have a subscription, the access depends on the API key used. A subscription is bound to each API key at minting (explicit or highest priority). See [Understanding Token Management](token-management.md).
Copy file name to clipboardExpand all lines: docs/content/configuration-and-management/subscription-known-issues.md
+5-30Lines changed: 5 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,32 +2,6 @@
2
2
3
3
This document describes known issues and operational considerations for the subscription-based MaaS Platform.
4
4
5
-
## X-MaaS-Subscription Header
6
-
7
-
### Multiple Subscriptions Require Header
8
-
9
-
**Impact:** High
10
-
11
-
**Description:**
12
-
13
-
When a user belongs to multiple groups that each have a MaaSSubscription, the client **must** send the `X-MaaS-Subscription` header to specify which subscription's rate limits apply. If the header is omitted, the MaaS API returns an error and the request is denied with **403 Forbidden**.
14
-
15
-
**Example:**
16
-
17
-
```text
18
-
User in groups: [system:authenticated, premium-users]
0 commit comments