Skip to content

Commit 2f6a2f1

Browse files
authored
Merge pull request #209 from kernel/release-please--branches--main--changes--next--components--sdk
release: 0.125.0
2 parents 3466ccd + afa92e7 commit 2f6a2f1

6 files changed

Lines changed: 90 additions & 5 deletions

File tree

‎.release-please-manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.124.0"
2+
".": "0.125.0"
33
}

‎CHANGELOG.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [0.125.0](https://github.com/kernel/kernel-node-sdk/compare/v0.124.0...v0.125.0) (2026-10-13)
4+
5+
6+
### Features
7+
8+
* chore(stlc): seal custom-code tracking files ([635766d](https://github.com/kernel/kernel-node-sdk/commit/635766db0f0e9d2dada9f134403533b97c41e7b2))
9+
310
## [0.124.0](https://github.com/kernel/kernel-node-sdk/compare/v0.123.0...v0.124.0) (2026-10-13)
411

512

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@onkernel/sdk",
3-
"version": "0.124.0",
3+
"version": "0.125.0",
44
"description": "The official TypeScript library for the Kernel API",
55
"author": "Kernel <>",
66
"types": "dist/index.d.ts",

‎src/resources/api-keys.ts‎

Lines changed: 76 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import { path } from '../internal/utils/path';
1212
*/
1313
export class APIKeys extends APIResource {
1414
/**
15-
* Create a new API key within the authenticated organization.
15+
* Create a new API key. API keys may be scoped by project and may include a
16+
* policy.
1617
*
1718
* @example
1819
* ```ts
@@ -156,6 +157,12 @@ export interface APIKey {
156157
* project name is unavailable.
157158
*/
158159
project_name: string | null;
160+
161+
/**
162+
* Permissions granted to a scoped API key. Absent for an ordinary key, which keeps
163+
* unrestricted access within its organization or project.
164+
*/
165+
policy?: APIKey.Policy | null;
159166
}
160167

161168
export namespace APIKey {
@@ -175,6 +182,32 @@ export namespace APIKey {
175182
*/
176183
name: string | null;
177184
}
185+
186+
/**
187+
* Permissions granted to a scoped API key. Absent for an ordinary key, which keeps
188+
* unrestricted access within its organization or project.
189+
*/
190+
export interface Policy {
191+
/**
192+
* Allow statements. Every action and resource not listed is denied.
193+
*/
194+
statements: Array<Policy.Statement>;
195+
}
196+
197+
export namespace Policy {
198+
export interface Statement {
199+
/**
200+
* Permitted action, such as browsers:use or vaults:read.
201+
*/
202+
action: string;
203+
204+
/**
205+
* Resource the action applies to, in the format projects/{project_id}/{kind}/{id}.
206+
* Wildcards are supported.
207+
*/
208+
resource: string;
209+
}
210+
}
178211
}
179212

180213
/**
@@ -194,16 +227,57 @@ export interface APIKeyCreateParams {
194227
name: string;
195228

196229
/**
197-
* Number of days until expiry, up to 3650. Use null for never.
230+
* Number of days until expiry, up to 3650. Use null for never. Cannot be combined
231+
* with expires_at.
198232
*/
199233
days_to_expire?: number | null;
200234

235+
/**
236+
* Exact expiry time. Must be in the future and no later than the issuing
237+
* credential's own expiry. Cannot be combined with days_to_expire.
238+
*/
239+
expires_at?: string | null;
240+
241+
/**
242+
* Issue a scoped key that may only perform the listed actions on the listed
243+
* resources.
244+
*/
245+
policy?: APIKeyCreateParams.Policy;
246+
201247
/**
202248
* Unique project identifier
203249
*/
204250
project_id?: string | null;
205251
}
206252

253+
export namespace APIKeyCreateParams {
254+
/**
255+
* Issue a scoped key that may only perform the listed actions on the listed
256+
* resources.
257+
*/
258+
export interface Policy {
259+
/**
260+
* Allow statements. Every action and resource not listed is denied.
261+
*/
262+
statements: Array<Policy.Statement>;
263+
}
264+
265+
export namespace Policy {
266+
export interface Statement {
267+
/**
268+
* Permitted action, such as browsers:use or vaults:read.
269+
*/
270+
action: string;
271+
272+
/**
273+
* Resource the action applies to, in the format projects/{project_id}/{kind}/{id}.
274+
* Wildcards are supported.
275+
*/
276+
resource: string;
277+
}
278+
}
279+
}
280+
207281
export interface APIKeyRetrieveParams {
208282
/**
209283
* When true, return the API key even if it has been deleted (soft-deleted), for

‎src/version.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const VERSION = '0.124.0'; // x-release-please-version
1+
export const VERSION = '0.125.0'; // x-release-please-version

‎tests/api-resources/api-keys.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ describe('resource apiKeys', () => {
2525
const response = await client.apiKeys.create({
2626
name: 'staging',
2727
days_to_expire: 30,
28+
expires_at: '2025-01-15T09:00:00Z',
29+
policy: {
30+
statements: [{ action: 'browsers:use', resource: 'projects/proj_abc123/browsers/br_abc123' }],
31+
},
2832
project_id: 'proj_abc123',
2933
});
3034
});

0 commit comments

Comments
 (0)