@origincloud/sts 0.25.0 → 0.25.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.
@@ -0,0 +1,2 @@
1
+ export * from "./sts.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/v1beta1/index.ts"],"names":[],"mappings":"AAEA,cAAc,UAAU,CAAC"}
@@ -0,0 +1,3 @@
1
+ // Code generated by the SDK's generator (generator/). DO NOT EDIT.
2
+ export * from "./sts.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1beta1/index.ts"],"names":[],"mappings":"AAAA,mEAAmE;AAEnE,cAAc,UAAU,CAAC"}
@@ -0,0 +1,64 @@
1
+ import type { CallOptions, Client, Service } from "@origincloud/core";
2
+ /**
3
+ * Calls SecurityTokenService.
4
+ *
5
+ * The security token service: it turns a token from an identity provider
6
+ * outside Origin Cloud, such as a CI job's OIDC token, into the access token
7
+ * of a `WORKLOAD` service account that trusts it through a federated
8
+ * credential. It authenticates no caller: the token is the proof.
9
+ */
10
+ export declare class SecurityTokenClient {
11
+ /**
12
+ * The endpoint the client sends its calls to, which also serves the
13
+ * operations its methods answer with.
14
+ */
15
+ readonly service: Service;
16
+ /** A client of SecurityTokenService that sends its calls through `client`. */
17
+ constructor(client: Client);
18
+ /**
19
+ * Assumes a `WORKLOAD` service account with an OIDC token. Exactly one
20
+ * federated credential, of the named service account or of any, must
21
+ * trust the token: its issuer and audience, and every one of its
22
+ * conditions. The token is verified with its issuer's published keys
23
+ * (RS256), and a pull request's job is admitted only by a credential that
24
+ * names its `event_name`. Refused with `PERMISSION_DENIED` when the token
25
+ * isn't trusted, without saying why, and with `UNAVAILABLE` when its
26
+ * issuer or the trust can't be read now.
27
+ */
28
+ assumeServiceAccount(request: AssumeServiceAccountRequest, options?: CallOptions): Promise<AssumeServiceAccountResponse>;
29
+ }
30
+ /** The request of `AssumeServiceAccount`. */
31
+ export interface AssumeServiceAccountRequest {
32
+ /** The OIDC token, a JWT its issuer signed, such as a CI job's. */
33
+ token?: string;
34
+ /**
35
+ * The service account to assume,
36
+ * `organizations/{organization}/serviceAccounts/{service_account}`. Only
37
+ * its federated credentials are considered. Without it, any service
38
+ * account's credential that trusts the token is.
39
+ */
40
+ serviceAccount?: string;
41
+ /**
42
+ * How long the access token lives: from 60 seconds to 1 hour, 15 minutes
43
+ * when unset.
44
+ */
45
+ lifetime?: string;
46
+ }
47
+ /** The response of `AssumeServiceAccount`. */
48
+ export interface AssumeServiceAccountResponse {
49
+ /**
50
+ * The service account's access token, sent as `Authorization: Bearer
51
+ * <access_token>`.
52
+ */
53
+ accessToken?: string;
54
+ /** When the access token expires. */
55
+ expireTime?: string;
56
+ /**
57
+ * The service account assumed,
58
+ * `organizations/{organization}/serviceAccounts/{service_account}`.
59
+ */
60
+ serviceAccount?: string;
61
+ /** The federated credential that trusted the token. */
62
+ federatedCredential?: string;
63
+ }
64
+ //# sourceMappingURL=sts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sts.d.ts","sourceRoot":"","sources":["../../src/v1beta1/sts.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEtE;;;;;;;GAOG;AACH,qBAAa,mBAAmB;IAC9B;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B,8EAA8E;gBAClE,MAAM,EAAE,MAAM;IAI1B;;;;;;;;;OASG;IACG,oBAAoB,CAAC,OAAO,EAAE,2BAA2B,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,4BAA4B,CAAC;CAU/H;AAED,6CAA6C;AAC7C,MAAM,WAAW,2BAA2B;IAC1C,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,8CAA8C;AAC9C,MAAM,WAAW,4BAA4B;IAC3C;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qCAAqC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uDAAuD;IACvD,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B"}
@@ -0,0 +1,39 @@
1
+ // Code generated by the SDK's generator (generator/). DO NOT EDIT.
2
+ // source: origincloud/sts/v1beta1/sts.proto
3
+ /**
4
+ * Calls SecurityTokenService.
5
+ *
6
+ * The security token service: it turns a token from an identity provider
7
+ * outside Origin Cloud, such as a CI job's OIDC token, into the access token
8
+ * of a `WORKLOAD` service account that trusts it through a federated
9
+ * credential. It authenticates no caller: the token is the proof.
10
+ */
11
+ export class SecurityTokenClient {
12
+ /**
13
+ * The endpoint the client sends its calls to, which also serves the
14
+ * operations its methods answer with.
15
+ */
16
+ service;
17
+ /** A client of SecurityTokenService that sends its calls through `client`. */
18
+ constructor(client) {
19
+ this.service = client.service("sts", false);
20
+ }
21
+ /**
22
+ * Assumes a `WORKLOAD` service account with an OIDC token. Exactly one
23
+ * federated credential, of the named service account or of any, must
24
+ * trust the token: its issuer and audience, and every one of its
25
+ * conditions. The token is verified with its issuer's published keys
26
+ * (RS256), and a pull request's job is admitted only by a credential that
27
+ * names its `event_name`. Refused with `PERMISSION_DENIED` when the token
28
+ * isn't trusted, without saying why, and with `UNAVAILABLE` when its
29
+ * issuer or the trust can't be read now.
30
+ */
31
+ async assumeServiceAccount(request, options) {
32
+ return this.service.call({
33
+ method: "POST",
34
+ path: `/v1beta1:assumeServiceAccount`,
35
+ body: request,
36
+ }, options);
37
+ }
38
+ }
39
+ //# sourceMappingURL=sts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sts.js","sourceRoot":"","sources":["../../src/v1beta1/sts.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,4CAA4C;AAI5C;;;;;;;GAOG;AACH,MAAM,OAAO,mBAAmB;IAC9B;;;OAGG;IACM,OAAO,CAAU;IAE1B,8EAA8E;IAC9E,YAAY,MAAc;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,oBAAoB,CAAC,OAAoC,EAAE,OAAqB;QACpF,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,+BAA+B;YACrC,IAAI,EAAE,OAAO;SACd,EACD,OAAO,CACR,CAAC;IACJ,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@origincloud/sts",
3
- "version": "0.25.0",
3
+ "version": "0.25.1",
4
4
  "description": "Origin Cloud's STS service: the security token service: it turns a token from an identity provider outside Origin Cloud, such as a CI job's OIDC token, into the access token of a WORKLOAD service account that trusts it through a federated credential.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/origincloudhq/sdk-typescript#readme",
@@ -34,9 +34,9 @@
34
34
  "!dist/**/*.tsbuildinfo"
35
35
  ],
36
36
  "peerDependencies": {
37
- "@origincloud/core": "^0.25.0"
37
+ "@origincloud/core": "^0.25.1"
38
38
  },
39
39
  "devDependencies": {
40
- "@origincloud/core": "^0.25.0"
40
+ "@origincloud/core": "^0.25.1"
41
41
  }
42
42
  }
@@ -20,7 +20,7 @@ export class SecurityTokenClient {
20
20
 
21
21
  /** A client of SecurityTokenService that sends its calls through `client`. */
22
22
  constructor(client: Client) {
23
- this.service = client.service("sts", true);
23
+ this.service = client.service("sts", false);
24
24
  }
25
25
 
26
26
  /**