@fabrika/iam-contract 0.4.8 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/index.ts +16 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fabrika/iam-contract",
3
- "version": "0.4.8",
3
+ "version": "0.5.1",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,7 +24,7 @@
24
24
  "typecheck": "tsc --noEmit"
25
25
  },
26
26
  "dependencies": {
27
- "@fabrika/app": "0.4.8",
28
- "@fabrika/auth-core": "0.4.8"
27
+ "@fabrika/app": "0.5.1",
28
+ "@fabrika/auth-core": "0.5.1"
29
29
  }
30
30
  }
package/src/index.ts CHANGED
@@ -229,6 +229,21 @@ export interface ApiKeyDto {
229
229
  createdAt: number
230
230
  }
231
231
 
232
+ /**
233
+ * One API key with its live credential. Its permissions are its grants, edited with `grants.create` and
234
+ * `grants.delete` by an installation administrator and read again at every token exchange.
235
+ */
236
+ export interface ApiKeyDetail extends ApiKeyDto {
237
+ /** The key's live credential, or null when none is live (a revoked key). */
238
+ credential: ApiKeyCredentialDto | null
239
+ }
240
+
241
+ export interface ApiKeyCredentialDto {
242
+ /** The app the key mints tokens for; null = every app. A grant at another app never reaches the key's token. */
243
+ app: string | null
244
+ expiresAt: number | null
245
+ }
246
+
232
247
  export interface ProvisionApiKeyRequest {
233
248
  label: string
234
249
  type: 'service'
@@ -641,6 +656,7 @@ export interface IamAdminRpcContract {
641
656
  }
642
657
  apiKeys: {
643
658
  list: RpcProcedure<ListApiKeysInput, CursorList<ApiKeyDto>>
659
+ get: RpcProcedure<ApiKeyIdInput, ApiKeyDetail>
644
660
  provision: RpcProcedure<ProvisionApiKeyRequest, ProvisionApiKeyResponse>
645
661
  rotate: RpcProcedure<RotateApiKeyInput, RotateApiKeyResponse>
646
662
  revoke: RpcProcedure<ApiKeyIdInput, OkResponse>