Skip to content

Commit e0de7dc

Browse files
feat: token format redesign (#102)
* feat: token format redesign * apply suggestions * apply suggestions * fix: update summary and headline --------- Co-authored-by: Jannis Mattheis <contact@jmattheis.de>
1 parent b5fe135 commit e0de7dc

1 file changed

Lines changed: 27 additions & 7 deletions

File tree

docs/migrate-to-3.md

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
with [`migrate-config`](#migrating-your-config).
1010
- If you set list or map environment variables, their syntax changed, see
1111
[List and map syntax](#list-and-map-syntax).
12+
- API tokens are no longer returned in the GET endpoints and are only exposed
13+
on creation or rotation. See [Tokens are only shown once](#tokens-are-only-shown-once).
1214
- If you have scripts hitting client-token endpoints, they may now need
1315
[elevation](#adapting-your-scripts).
1416

@@ -78,34 +80,52 @@ GOTIFY_SERVER_RESPONSEHEADERS={"X-Custom-Header":"custom value"}
7880

7981
## API Changes
8082

83+
### Tokens are only shown once
84+
85+
As part of an effort to align with secure API design principles,
86+
tokens will no longer be returned via the API or WebUI except when the token is issued via creation or rotation.
87+
Workflows dependent on introspecting existing clients or applications for their token will stop working.
88+
89+
::: tip
90+
The post message endpoint now accepts an "appid" parameter, which allows clients
91+
to impersonate applications they control without knowing the corresponding application token.
92+
:::
93+
94+
Tokens for existing applications can now be rotated via the _application security update_ endpoint.
95+
96+
Existing tokens (starting with `A` and `C`) will continue to work.
97+
Plugin tokens (starting with `P`) used to access web resources are not affected by this change.
98+
99+
### Step-up Authentication
100+
81101
Introduces step-up authentication via time-limited [session
82102
elevation](./session-elevation.md). A session/client token must re-authenticate
83103
before sensitive, hard-to-undo actions.
84104

85105
HTTP Basic auth and application tokens are unaffected.
86106

87-
### Endpoints that now require elevation
88-
89107
With a non-elevated client token these return `403`:
90108

91109
| Endpoint | Action |
92110
| :-------------------------------------------- | :----------------------------- |
93111
| `POST /current/user/password` | Change current user's password |
94112
| `DELETE /client/{id}` | Delete a client |
95113
| `DELETE /application/{id}` | Delete an application |
114+
| `PUT /application/{id}/security` | Application security update |
96115
| `POST /client/{id}/elevate` | Elevate a client token |
97116
| `GET /user`, `GET`/`POST`/`DELETE /user/{id}` | Manage users (admin) |
98117

99118
The `Client` and `CurrentUser` models have gotten elevation-related fields. See the
100119
[API documentation](/api-docs) for details.
101120

102-
### Adapting your scripts
121+
::: tip
122+
123+
To update your workflow that uses the endpoints above with a client token. Perform a separate elevation process before the call. Either:
103124

104-
Scripts that hit the endpoints above with a client token now need that token to
105-
be elevated. Either:
125+
- Transitition to use HTTP Basic auth as they are elevated by default.
126+
- Elevate the client in the WebUI or the api with basic auth before calling these APIs.
106127

107-
- Use HTTP Basic auth as they are elevated by default.
108-
- Elevate the client in the WebUI or the api with basic auth.
128+
:::
109129

110130
## CLI Changes
111131

0 commit comments

Comments
 (0)