Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ export const workspacePermissions = {
},
},
Keys: {
verify_key: {
description: "Verify API keys and enforce rate limits and permissions.",
permission: "api.*.verify_key",
},
create_key: {
description: "Create new keys in this workspace.",
permission: "api.*.create_key",
Expand Down Expand Up @@ -145,7 +149,9 @@ export const workspacePermissions = {
},
},
} satisfies Record<string, UnkeyPermissions>;
export function apiPermissions(apiId: string): { [category: string]: UnkeyPermissions } {
export function apiPermissions(apiId: string): {
[category: string]: UnkeyPermissions;
} {
return {
API: {
read_api: {
Expand All @@ -163,6 +169,11 @@ export function apiPermissions(apiId: string): { [category: string]: UnkeyPermis
},
},
Keys: {
verify_key: {
description:
"Verify keys belonging to this API and enforce their rate limits and permissions.",
permission: `api.${apiId}.verify_key`,
},
create_key: {
description: "Create a new key for this API.",
permission: `api.${apiId}.create_key`,
Expand Down
1 change: 1 addition & 0 deletions packages/rbac/src/permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const apiActions = z.enum([
"encrypt_key",
"decrypt_key",
"read_key",
"verify_key",
]);
export const ratelimitActions = z.enum([
"limit",
Expand Down
Loading