@astrale-os/kernel-client 0.6.0-beta.58 → 0.6.0-beta.59
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.
package/dist/auth/auth.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { PathLike } from '@astrale-os/kernel-core/path';
|
|
|
3
3
|
import type { Input } from '../client/index.js';
|
|
4
4
|
import type { RequestOptions } from '../transport/index.js';
|
|
5
5
|
import type { PolicyDecisionInput } from './authorization.js';
|
|
6
|
-
import type { DelegateOptions, MintOptions } from './credential.js';
|
|
6
|
+
import type { DelegateOptions, MintOptions, ImpersonateOptions } from './credential.js';
|
|
7
7
|
import type { WhoisInput } from './identity.js';
|
|
8
8
|
import type { RegisterRequest } from './register.js';
|
|
9
9
|
export type AuthCall = (target: PathLike, input: Input, options?: RequestOptions) => Promise<Input>;
|
|
@@ -12,6 +12,7 @@ export interface AuthApi {
|
|
|
12
12
|
whoami(options?: RequestOptions): Promise<Identity & Authentication>;
|
|
13
13
|
whois(input: WhoisInput, options?: RequestOptions): Promise<(Identity & Authentication) | null>;
|
|
14
14
|
can(input: PolicyDecisionInput, options?: RequestOptions): Promise<boolean>;
|
|
15
|
+
impersonate(input: ImpersonateOptions, options?: RequestOptions): Promise<MintedCredential>;
|
|
15
16
|
mint(input: MintOptions, options?: RequestOptions): Promise<MintedCredential>;
|
|
16
17
|
delegate(identity: IdentityId, input: DelegateOptions, options?: RequestOptions): Promise<MintedCredential>;
|
|
17
18
|
}
|
|
@@ -7,13 +7,18 @@ export interface MintOptions {
|
|
|
7
7
|
readonly ttlSeconds: number;
|
|
8
8
|
readonly grant?: UnresolvedGrant;
|
|
9
9
|
}
|
|
10
|
+
export interface ImpersonateOptions extends MintOptions {
|
|
11
|
+
readonly identity: IdentityId;
|
|
12
|
+
}
|
|
10
13
|
export interface DelegateOptions {
|
|
11
14
|
readonly audience: string;
|
|
12
15
|
readonly ttlSeconds: number;
|
|
13
16
|
readonly attenuation: UnresolvedIdentityExpr;
|
|
14
17
|
}
|
|
18
|
+
export declare const IDENTITY_IMPERSONATE_PATH: NodePath;
|
|
15
19
|
export declare const IDENTITY_MINT_PATH: NodePath;
|
|
16
20
|
export declare function credentialApi(call: AuthCall): Readonly<{
|
|
21
|
+
impersonate(input: ImpersonateOptions, options?: RequestOptions): Promise<MintedCredential>;
|
|
17
22
|
mint(input: MintOptions, options?: RequestOptions): Promise<MintedCredential>;
|
|
18
23
|
delegate(principal: IdentityId, input: DelegateOptions, options?: RequestOptions): Promise<MintedCredential>;
|
|
19
24
|
}>;
|
package/dist/auth/credential.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { Path } from '@astrale-os/kernel-core/path';
|
|
2
2
|
import { identity } from '@astrale-os/kernel-core/schema/kernel/syscalls/references';
|
|
3
3
|
const identityOwner = Path.project(identity.whoami.owner);
|
|
4
|
+
export const IDENTITY_IMPERSONATE_PATH = Path.staticMethod(identityOwner, identity.impersonate.name).raw;
|
|
4
5
|
export const IDENTITY_MINT_PATH = Path.staticMethod(identityOwner, identity.mint.name).raw;
|
|
5
6
|
export function credentialApi(call) {
|
|
6
7
|
return Object.freeze({
|
|
8
|
+
async impersonate(input, options) {
|
|
9
|
+
return credential(await call(IDENTITY_IMPERSONATE_PATH, input, options));
|
|
10
|
+
},
|
|
7
11
|
async mint(input, options) {
|
|
8
12
|
return credential(await call(IDENTITY_MINT_PATH, input, options));
|
|
9
13
|
},
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { createAuth, type AuthApi, type AuthCall } from './auth.js';
|
|
2
2
|
export { IDENTITY_CAN_PATH, type PolicyDecisionInput } from './authorization.js';
|
|
3
|
-
export { IDENTITY_MINT_PATH, type DelegateOptions, type MintOptions } from './credential.js';
|
|
3
|
+
export { IDENTITY_MINT_PATH, IDENTITY_IMPERSONATE_PATH, type DelegateOptions, type MintOptions, type ImpersonateOptions, } from './credential.js';
|
|
4
4
|
export { IDENTITY_WHOAMI_PATH, IDENTITY_WHOIS_PATH, type WhoisInput } from './identity.js';
|
|
5
5
|
export { IDENTITY_REGISTER_PATH, type RegisterIdentity, type RegisterRequest } from './register.js';
|
|
6
6
|
export type { Identity, IdentityId, Subject, IssuerId, MintedCredential, RegisterResult, UnresolvedGrant, UnresolvedIdentityExpr, } from '@astrale-os/kernel-core/auth';
|
package/dist/auth/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { createAuth } from './auth.js';
|
|
2
2
|
export { IDENTITY_CAN_PATH } from './authorization.js';
|
|
3
|
-
export { IDENTITY_MINT_PATH } from './credential.js';
|
|
3
|
+
export { IDENTITY_MINT_PATH, IDENTITY_IMPERSONATE_PATH, } from './credential.js';
|
|
4
4
|
export { IDENTITY_WHOAMI_PATH, IDENTITY_WHOIS_PATH } from './identity.js';
|
|
5
5
|
export { IDENTITY_REGISTER_PATH } from './register.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrale-os/kernel-client",
|
|
3
|
-
"version": "0.6.0-beta.
|
|
3
|
+
"version": "0.6.0-beta.59",
|
|
4
4
|
"description": "Universal Client — protocol-first, transport-agnostic",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astrale",
|
|
@@ -65,14 +65,14 @@
|
|
|
65
65
|
"access": "public"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@astrale-os/kernel-core": "0.9.0-beta.
|
|
68
|
+
"@astrale-os/kernel-core": "0.9.0-beta.46",
|
|
69
69
|
"@astrale-os/kernel-dsl": "0.2.0-beta.33",
|
|
70
|
-
"@astrale-os/kernel-protocol": "0.5.0-beta.
|
|
70
|
+
"@astrale-os/kernel-protocol": "0.5.0-beta.50",
|
|
71
71
|
"@tanstack/pacer": "0.20.1",
|
|
72
72
|
"msgpackr": "^2.0.5"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@astrale-os/kernel-server": "0.5.0-beta.
|
|
75
|
+
"@astrale-os/kernel-server": "0.5.0-beta.52",
|
|
76
76
|
"@astrale/typescript-config": "npm:@jsr/astrale__typescript-config@~1.1.0",
|
|
77
77
|
"@types/node": "^22.0.0",
|
|
78
78
|
"typescript": "7.0.2",
|