Commit f77f2b3
authored
fix: migrate verify script from removed /v1/tokens to /v1/api-keys (opendatahub-io#546)
The verify-models-and-limits.sh script was broken because it called the
removed /maas-api/v1/tokens endpoint. This migrates it to the current
/v1/api-keys flow. Model discovery stays on the /v1/models API (no
kubectl calls).
Changes:
Use POST /maas-api/v1/api-keys with named keys instead of removed
/v1/tokens
Parse .key and .id from API key response
Clean up temporary API key on exit via DELETE /v1/api-keys/{id}
Remove unused USER_NAME and stale JWT decoding logic
Prerequisite: The maas-api-auth-policy must support API key
authentication (see deployment/base/maas-api/policies/auth-policy.yaml).
The ODH operator currently deploys a stale version without API key
support.
How Has This Been Tested?
Ran the script end-to-end on a live cluster
(maas.apps.giteltal.dev.datahub.redhat.com)
API key creation, model discovery, inference, rate limiting, and cleanup
all passed
Merge criteria:
The commits are squashed in a cohesive manner and have meaningful
messages.
Testing instructions have been added in the PR body.
The developer has manually tested the changes and verified that the
changes work.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Chores**
* Switched verification scripts from token-based to API key-based
authentication and updated related messaging.
* Added creation and guaranteed cleanup (revocation) of temporary API
keys, with improved success/error reporting.
* Removed JWT decoding and related user-extraction steps; updated model
discovery and inference calls to use API key authorization.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 1cbba6f commit f77f2b3
1 file changed
+28
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
4 | 8 | | |
5 | 9 | | |
6 | 10 | | |
| |||
73 | 77 | | |
74 | 78 | | |
75 | 79 | | |
76 | | - | |
| 80 | + | |
77 | 81 | | |
78 | 82 | | |
79 | 83 | | |
| |||
82 | 86 | | |
83 | 87 | | |
84 | 88 | | |
| 89 | + | |
| 90 | + | |
85 | 91 | | |
86 | 92 | | |
87 | 93 | | |
88 | 94 | | |
89 | | - | |
| 95 | + | |
90 | 96 | | |
91 | | - | |
| 97 | + | |
92 | 98 | | |
93 | 99 | | |
94 | 100 | | |
95 | 101 | | |
96 | 102 | | |
97 | | - | |
| 103 | + | |
98 | 104 | | |
99 | 105 | | |
100 | 106 | | |
101 | 107 | | |
102 | 108 | | |
103 | | - | |
104 | | - | |
105 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
106 | 113 | | |
107 | 114 | | |
108 | 115 | | |
109 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
110 | 125 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
| 126 | + | |
119 | 127 | | |
120 | 128 | | |
121 | 129 | | |
| |||
316 | 324 | | |
317 | 325 | | |
318 | 326 | | |
319 | | - | |
320 | | - | |
| 327 | + | |
| 328 | + | |
321 | 329 | | |
322 | 330 | | |
323 | 331 | | |
| |||
347 | 355 | | |
348 | 356 | | |
349 | 357 | | |
350 | | - | |
351 | 358 | | |
352 | 359 | | |
353 | 360 | | |
| |||
357 | 364 | | |
358 | 365 | | |
359 | 366 | | |
| 367 | + | |
0 commit comments