- Notifications
You must be signed in to change notification settings - Fork905
Commitf569d9c
authored
feat: add separate max token lifetime for administrators (#18267)
# Add separate token lifetime limits for administratorsThis PR introduces a new configuration option `--max-admin-token-lifetime` that allows administrators to create API tokens with longer lifetimes than regular users. By default, administrators can create tokens with a lifetime of up to 7 days (168 hours), while the existing `--max-token-lifetime` setting continues to apply to regular users.The implementation:- Adds a new `MaximumAdminTokenDuration` field to the session configuration- Modifies the token validation logic to check the user's role and apply the appropriate lifetime limit- Updates the token configuration endpoint to return the correct maximum lifetime based on the user's role- Adds tests to verify that administrators can create tokens with longer and shorter lifetimes- Updates documentation and help text to reflect the new optionThis change allows organizations to grant administrators extended token lifetimes while maintaining tighter security controls for regular users.Fixes#173951 parent348d19d commitf569d9c
File tree
12 files changed
+178
-13
lines changed- cli/testdata
- coderd
- apidoc
- codersdk
- docs/reference
- api
- cli
- enterprise/cli/testdata
- site/src/api
12 files changed
+178
-13
lines changedLines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
332 | 332 |
| |
333 | 333 |
| |
334 | 334 |
| |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
335 | 339 |
| |
336 | 340 |
| |
337 | 341 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
28 | 32 |
| |
29 | 33 |
| |
30 | 34 |
| |
|
Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Lines changed: 42 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
| 21 | + | |
21 | 22 |
| |
22 | 23 |
| |
23 | 24 |
| |
| |||
75 | 76 |
| |
76 | 77 |
| |
77 | 78 |
| |
78 |
| - | |
| 79 | + | |
79 | 80 |
| |
80 | 81 |
| |
81 | 82 |
| |
| |||
338 | 339 |
| |
339 | 340 |
| |
340 | 341 |
| |
341 |
| - | |
| 342 | + | |
| 343 | + | |
342 | 344 |
| |
343 |
| - | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
344 | 349 |
| |
345 | 350 |
| |
346 | 351 |
| |
347 | 352 |
| |
348 | 353 |
| |
349 | 354 |
| |
350 |
| - | |
| 355 | + | |
351 | 356 |
| |
352 | 357 |
| |
353 | 358 |
| |
354 | 359 |
| |
355 |
| - | |
| 360 | + | |
356 | 361 |
| |
357 | 362 |
| |
358 | 363 |
| |
359 | 364 |
| |
360 |
| - | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
361 | 371 |
| |
362 | 372 |
| |
363 |
| - | |
| 373 | + | |
364 | 374 |
| |
365 | 375 |
| |
366 | 376 |
| |
367 | 377 |
| |
368 | 378 |
| |
369 | 379 |
| |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
370 | 405 |
| |
371 | 406 |
| |
372 | 407 |
| |
|
Lines changed: 82 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
144 | 144 |
| |
145 | 145 |
| |
146 | 146 |
| |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
147 | 229 |
| |
148 | 230 |
| |
149 | 231 |
| |
|
Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
468 | 468 |
| |
469 | 469 |
| |
470 | 470 |
| |
| 471 | + | |
| 472 | + | |
471 | 473 |
| |
472 | 474 |
| |
473 | 475 |
| |
| |||
2340 | 2342 |
| |
2341 | 2343 |
| |
2342 | 2344 |
| |
| 2345 | + | |
| 2346 | + | |
| 2347 | + | |
| 2348 | + | |
| 2349 | + | |
| 2350 | + | |
| 2351 | + | |
| 2352 | + | |
| 2353 | + | |
| 2354 | + | |
| 2355 | + | |
2343 | 2356 |
| |
2344 | 2357 |
| |
2345 | 2358 |
| |
|
Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Lines changed: 10 additions & 6 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
333 | 333 |
| |
334 | 334 |
| |
335 | 335 |
| |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
336 | 340 |
| |
337 | 341 |
| |
338 | 342 |
| |
|
Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
0 commit comments
Comments
(0)