@gjermundgaraba/clankercreds-api 0.4.0 → 0.5.0
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/admin.d.ts +4 -2
- package/dist/admin.js +2 -1
- package/dist/credentials.d.ts +5 -2
- package/dist/credentials.js +3 -2
- package/dist/machine.d.ts +9 -4
- package/dist/machine.js +5 -2
- package/package.json +1 -1
package/dist/admin.d.ts
CHANGED
|
@@ -157,7 +157,8 @@ export declare const Admin: readonly [Action.Action<"listCredentials", Schema.$R
|
|
|
157
157
|
}>, readonly never[], true, typeof CurrentPrincipal>, Action.Action<"putCredential", Schema.Struct<{
|
|
158
158
|
readonly name: Schema.String;
|
|
159
159
|
readonly kind: Schema.Literals<readonly ["gh", "claude", "token"]>;
|
|
160
|
-
|
|
160
|
+
/** Surrounding whitespace, such as a pasted line ending, is not part of a secret: a value carrying any is refused, never altered. */
|
|
161
|
+
readonly value: Schema.Trimmed;
|
|
161
162
|
readonly host: Schema.optionalKey<Schema.String>;
|
|
162
163
|
/** Any date string JavaScript parses; a typo is refused, so alerting never loses it. Left out, it does not expire. */
|
|
163
164
|
readonly expiresAt: Schema.optionalKey<Schema.DateFromString>;
|
|
@@ -288,7 +289,8 @@ export declare const AdminHttp: ActionHttp.Binding<readonly [Action.Action<"list
|
|
|
288
289
|
}>, readonly never[], true, typeof CurrentPrincipal>, Action.Action<"putCredential", Schema.Struct<{
|
|
289
290
|
readonly name: Schema.String;
|
|
290
291
|
readonly kind: Schema.Literals<readonly ["gh", "claude", "token"]>;
|
|
291
|
-
|
|
292
|
+
/** Surrounding whitespace, such as a pasted line ending, is not part of a secret: a value carrying any is refused, never altered. */
|
|
293
|
+
readonly value: Schema.Trimmed;
|
|
292
294
|
readonly host: Schema.optionalKey<Schema.String>;
|
|
293
295
|
/** Any date string JavaScript parses; a typo is refused, so alerting never loses it. Left out, it does not expire. */
|
|
294
296
|
readonly expiresAt: Schema.optionalKey<Schema.DateFromString>;
|
package/dist/admin.js
CHANGED
|
@@ -122,7 +122,8 @@ export const Admin = [
|
|
|
122
122
|
input: Schema.Struct({
|
|
123
123
|
name: Name,
|
|
124
124
|
kind: SecretKind,
|
|
125
|
-
|
|
125
|
+
/** Surrounding whitespace, such as a pasted line ending, is not part of a secret: a value carrying any is refused, never altered. */
|
|
126
|
+
value: Schema.Trimmed.check(Schema.isMinLength(1), Schema.isMaxLength(16_384)),
|
|
126
127
|
host: Schema.optionalKey(Host),
|
|
127
128
|
/** Any date string JavaScript parses; a typo is refused, so alerting never loses it. Left out, it does not expire. */
|
|
128
129
|
expiresAt: Schema.optionalKey(Schema.DateFromString),
|
package/dist/credentials.d.ts
CHANGED
|
@@ -42,13 +42,14 @@ export declare const PiCredential: Schema.Struct<{
|
|
|
42
42
|
}>;
|
|
43
43
|
/**
|
|
44
44
|
* A credential no machine places: an API key, or a Grok or Cursor login's access token, for
|
|
45
|
-
* a service such as clankerusage
|
|
46
|
-
*
|
|
45
|
+
* a service such as clankerusage. `kind` is the credential's own, and any string, so a kind
|
|
46
|
+
* newer than the caller's contract still decodes. The client skips one a config names.
|
|
47
47
|
*/
|
|
48
48
|
export declare const TokenCredential: Schema.Struct<{
|
|
49
49
|
readonly credential: Schema.String;
|
|
50
50
|
readonly expiresAt: Schema.NullOr<Schema.String>;
|
|
51
51
|
readonly type: Schema.Literal<"token">;
|
|
52
|
+
readonly kind: Schema.String;
|
|
52
53
|
readonly token: Schema.String;
|
|
53
54
|
}>;
|
|
54
55
|
/**
|
|
@@ -91,6 +92,7 @@ export declare const TypedCredential: Schema.Union<readonly [Schema.Struct<{
|
|
|
91
92
|
readonly credential: Schema.String;
|
|
92
93
|
readonly expiresAt: Schema.NullOr<Schema.String>;
|
|
93
94
|
readonly type: Schema.Literal<"token">;
|
|
95
|
+
readonly kind: Schema.String;
|
|
94
96
|
readonly token: Schema.String;
|
|
95
97
|
}>]>;
|
|
96
98
|
export type TypedCredential = typeof TypedCredential.Type;
|
|
@@ -134,6 +136,7 @@ export declare const Delivery: Schema.Struct<{
|
|
|
134
136
|
readonly credential: Schema.String;
|
|
135
137
|
readonly expiresAt: Schema.NullOr<Schema.String>;
|
|
136
138
|
readonly type: Schema.Literal<"token">;
|
|
139
|
+
readonly kind: Schema.String;
|
|
137
140
|
readonly token: Schema.String;
|
|
138
141
|
}>]>, Schema.Struct<{
|
|
139
142
|
readonly type: Schema.String;
|
package/dist/credentials.js
CHANGED
|
@@ -43,12 +43,13 @@ export const PiCredential = Schema.Struct({
|
|
|
43
43
|
});
|
|
44
44
|
/**
|
|
45
45
|
* A credential no machine places: an API key, or a Grok or Cursor login's access token, for
|
|
46
|
-
* a service such as clankerusage
|
|
47
|
-
*
|
|
46
|
+
* a service such as clankerusage. `kind` is the credential's own, and any string, so a kind
|
|
47
|
+
* newer than the caller's contract still decodes. The client skips one a config names.
|
|
48
48
|
*/
|
|
49
49
|
export const TokenCredential = Schema.Struct({
|
|
50
50
|
type: Schema.Literal("token"),
|
|
51
51
|
...fromCredential,
|
|
52
|
+
kind: Schema.String,
|
|
52
53
|
token: Schema.String,
|
|
53
54
|
});
|
|
54
55
|
/**
|
package/dist/machine.d.ts
CHANGED
|
@@ -5,10 +5,13 @@ import * as Authentication from "@gjermundgaraba/effect-actions/Authentication";
|
|
|
5
5
|
import { ProviderUnavailable } from "@gjermundgaraba/clankerauth-sdk/errors";
|
|
6
6
|
import { CurrentPrincipal } from "@gjermundgaraba/clankerauth-sdk/session";
|
|
7
7
|
import { claimsOf, ClientId, CredentialKind, keyIdOf, Name, NeedsSignIn, NotFound, UpstreamUnavailable } from "./shared.ts";
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* A credential the calling key may read, without its value. `kind` is any string, so a kind
|
|
10
|
+
* newer than the caller's contract does not fail the whole list.
|
|
11
|
+
*/
|
|
9
12
|
export declare const Grant: Schema.Struct<{
|
|
10
13
|
readonly name: Schema.String;
|
|
11
|
-
readonly kind: Schema.
|
|
14
|
+
readonly kind: Schema.String;
|
|
12
15
|
}>;
|
|
13
16
|
/**
|
|
14
17
|
* What a machine key can do: read the credentials it is granted, by name, and nothing else.
|
|
@@ -46,6 +49,7 @@ export declare const Machine: readonly [Action.Action<"sync", Schema.Struct<{
|
|
|
46
49
|
readonly credential: Schema.String;
|
|
47
50
|
readonly expiresAt: Schema.NullOr<Schema.String>;
|
|
48
51
|
readonly type: Schema.Literal<"token">;
|
|
52
|
+
readonly kind: Schema.String;
|
|
49
53
|
readonly token: Schema.String;
|
|
50
54
|
}>]>, Schema.Struct<{
|
|
51
55
|
readonly type: Schema.String;
|
|
@@ -60,7 +64,7 @@ export declare const Machine: readonly [Action.Action<"sync", Schema.Struct<{
|
|
|
60
64
|
}>, readonly (typeof NotFound | typeof NeedsSignIn | typeof UpstreamUnavailable)[], false, typeof CurrentPrincipal>, Action.Action<"listGrants", Schema.$Record<Schema.String, Schema.Never>, Schema.Struct<{
|
|
61
65
|
readonly credentials: Schema.$Array<Schema.Struct<{
|
|
62
66
|
readonly name: Schema.String;
|
|
63
|
-
readonly kind: Schema.
|
|
67
|
+
readonly kind: Schema.String;
|
|
64
68
|
}>>;
|
|
65
69
|
}>, readonly never[], true, typeof CurrentPrincipal>];
|
|
66
70
|
declare const CodexRefreshRejected_base: Schema.Class<CodexRefreshRejected, Schema.TaggedStruct<"CodexRefreshRejected", {
|
|
@@ -146,6 +150,7 @@ export declare const MachineHttp: ActionHttp.Binding<readonly [Action.Action<"sy
|
|
|
146
150
|
readonly credential: Schema.String;
|
|
147
151
|
readonly expiresAt: Schema.NullOr<Schema.String>;
|
|
148
152
|
readonly type: Schema.Literal<"token">;
|
|
153
|
+
readonly kind: Schema.String;
|
|
149
154
|
readonly token: Schema.String;
|
|
150
155
|
}>]>, Schema.Struct<{
|
|
151
156
|
readonly type: Schema.String;
|
|
@@ -160,7 +165,7 @@ export declare const MachineHttp: ActionHttp.Binding<readonly [Action.Action<"sy
|
|
|
160
165
|
}>, readonly (typeof NotFound | typeof NeedsSignIn | typeof UpstreamUnavailable)[], false, typeof CurrentPrincipal>, Action.Action<"listGrants", Schema.$Record<Schema.String, Schema.Never>, Schema.Struct<{
|
|
161
166
|
readonly credentials: Schema.$Array<Schema.Struct<{
|
|
162
167
|
readonly name: Schema.String;
|
|
163
|
-
readonly kind: Schema.
|
|
168
|
+
readonly kind: Schema.String;
|
|
164
169
|
}>>;
|
|
165
170
|
}>, readonly never[], true, typeof CurrentPrincipal>, Action.Action<"codexRefresh", Schema.StructWithRest<Schema.Struct<{
|
|
166
171
|
readonly grant_type: Schema.Literal<"refresh_token">;
|
package/dist/machine.js
CHANGED
|
@@ -6,8 +6,11 @@ import { ProviderUnavailable } from "@gjermundgaraba/clankerauth-sdk/errors";
|
|
|
6
6
|
import { CurrentPrincipal } from "@gjermundgaraba/clankerauth-sdk/session";
|
|
7
7
|
import { CodexLogin, Delivery } from "./credentials.js";
|
|
8
8
|
import { apiPath, claimsOf, ClientId, CredentialKind, keyIdOf, Name, NeedsSignIn, NotFound, UpstreamUnavailable, } from "./shared.js";
|
|
9
|
-
/**
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* A credential the calling key may read, without its value. `kind` is any string, so a kind
|
|
11
|
+
* newer than the caller's contract does not fail the whole list.
|
|
12
|
+
*/
|
|
13
|
+
export const Grant = Schema.Struct({ name: Name, kind: Schema.String });
|
|
11
14
|
/**
|
|
12
15
|
* What a machine key can do: read the credentials it is granted, by name, and nothing else.
|
|
13
16
|
* The caller names what it wants; the grants on the server decide whether it may. A machine
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjermundgaraba/clankercreds-api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "The clankercreds wire contract: the machine and admin actions and the typed credentials they deliver, for a typed client of either API.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|