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
* ✨ feat: add optional ID Token support
- Update configuration schema and Go structs to include idTokenKey
- Support saving ID tokens to .env files when configured
- Add --id-token flag to get command for direct output
- Add --id-token flag to inspect command for decoding
- Make ID token verification non-fatal to increase robustness
- Add unit tests for config loading and OIDC token handling
- Update README.md with new configuration options and flags
* ✨ feat: allow explicit token type in targets configuration
- Refactor `targets` schema to use `type` field instead of `idTokenKey`
- Update `inspect` command to intelligently resolve files and keys from the targets list
- Improve documentation for multiple target files and fix invalid examples in README
- Maintain backward compatibility for simple configuration via `tokenKey` and `idTokenKey`
By default, `authk` updates a single `.env` file. For more complex setups, you can define multiple targets to update different files or keys with different token types.
100
+
101
+
```cue
102
+
// Optional: Multiple targets configuration
103
+
targets: [
104
+
{
105
+
file: ".env"
106
+
key: "MY_ACCESS_TOKEN"
107
+
type: "access_token" // Default type
108
+
},
109
+
{
110
+
file: ".env"
111
+
key: "MY_ID_TOKEN"
112
+
type: "id_token"
113
+
},
114
+
{
115
+
file: "apps/frontend/.env"
116
+
key: "API_TOKEN"
117
+
}
118
+
]
119
+
```
120
+
121
+
When `targets` is defined, the global `tokenKey` and `idTokenKey` are ignored.
122
+
96
123
## Secrets Management
97
124
98
125
`authk` integrates with [vals](https://github.com/helmfile/vals) to support loading secrets securely from various sources. You can use special URI schemes in your configuration file to reference secrets instead of hardcoding them.
@@ -167,15 +194,20 @@ Fetches a valid token and prints it to stdout. Useful for piping to other comman
167
194
./authk get
168
195
```
169
196
197
+
**Flags:**
198
+
-`--id-token`: Print ID Token instead of Access Token
199
+
170
200
### Inspect Token
171
201
172
-
Reads the current token from the `.env` file and displays its decoded content (Header and Payload).
202
+
Reads the current token from the `.env` file and displays its decoded content (Header and Payload). It automatically uses the file and key defined in your `targets` if available.
173
203
174
204
```bash
175
205
./authk inspect
176
206
```
177
207
178
208
**Flags:**
209
+
-`--id-token`: Inspect the ID token instead of the Access token (searches for a target of type `id_token`)
210
+
-`--env`: Path to .env file. If multiple targets exist for different files, use this to specify which one to inspect.
179
211
-`--json`: Output as valid JSON without colors (useful for parsing)
0 commit comments