@usine/gateway/admin
Classes
Section titled “Classes”AdminAuthorization
Section titled “AdminAuthorization”Requires the gateway’s admin token as a bearer token on every admin
request; a missing or different token is answered with 401. Clients add the
header themselves, for example with HttpClientRequest.bearerToken.
Extends
Section titled “Extends”HttpApiMiddleware.ServiceClass
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AdminAuthorization(
_):AdminAuthorization
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
_ |
never |
Returns
Section titled “Returns”Attached
Section titled “Attached”The answer to an attach or a renewal: the attachment, and the caller token the Worker VM presents for it. A renewal of the same attachment id answers with the same token.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Attached(…
args):Attached
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”attachment
Section titled “attachment”
readonlyattachment:AttachmentSummary
callerToken
Section titled “callerToken”
readonlycallerToken:Redacted<string>
AttachmentList
Section titled “AttachmentList”The attachments in force.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AttachmentList(…
args):AttachmentList
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”attachments
Section titled “attachments”
readonlyattachments: readonlyAttachmentSummary[]
AttachmentSummary
Section titled “AttachmentSummary”An attachment as the admin API reports it: everything but the token itself.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AttachmentSummary(…
args):AttachmentSummary
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”credential
Section titled “credential”
readonlycredential:"InstallationCredential"|"AnonymousCredential"
expiresAt
Section titled “expiresAt”
readonlyexpiresAt:Utc
readonlyid:string&Brand<"AttachmentId">
repository
Section titled “repository”
readonlyrepository:string&Brand<"RepositoryName">
worker
Section titled “worker”
readonlyworker:string&Brand<"WorkerName">
Methods
Section titled “Methods”fromAttachment()
Section titled “fromAttachment()”
staticfromAttachment(attachment):AttachmentSummary
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
attachment |
Attachment |
Returns
Section titled “Returns”AttachRequest
Section titled “AttachRequest”What the executor attaches: one Attempt’s credential for one Worker and repository, until it expires.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AttachRequest(…
args):AttachRequest
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”credential
Section titled “credential”
readonlycredential:InstallationCredential|AnonymousCredential
expiresAt
Section titled “expiresAt”
readonlyexpiresAt:Utc
repository
Section titled “repository”
readonlyrepository:string&Brand<"RepositoryName">
worker
Section titled “worker”
readonlyworker:string&Brand<"WorkerName">
Detached
Section titled “Detached”The answer to a detach: whether the attachment existed.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Detached(…
args):Detached
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”detached
Section titled “detached”
readonlydetached:boolean
Variables
Section titled “Variables”GatewayAdminApi
Section titled “GatewayAdminApi”
constGatewayAdminApi:HttpApi.HttpApi<"GatewayAdminApi",HttpApiGroup.HttpApiGroup<"attachments",HttpApiEndpoint.HttpApiEndpoint<"attach","POST","/v1/attachments",never,never,Schema.toCodecJson<Schema.decodeTo<Schema.declareConstructor<AttachRequest, {credential: {_tag:"InstallationCredential";token:Redacted; } | {_tag:"AnonymousCredential"; };expiresAt:Utc;repository:string;worker:string; }, readonly [Schema.Struct<{credential: …;expiresAt: …;repository: …;worker: …; }>], {credential: {_tag:"InstallationCredential";token:Redacted; } | {_tag:"AnonymousCredential"; };expiresAt:Utc;repository:string&Brand;worker:string&Brand; }>,Schema.Struct<{credential:Schema.Union<readonly […, …]>;expiresAt:Schema.DateTimeUtc;repository:Schema.brand<Schema.String,"RepositoryName">;worker:Schema.brand<Schema.String,"WorkerName">; }>,never,never>>,never,Schema.toCodecJson<typeofAttached>,Schema.toCodecJson<Schema.decodeTo<Schema.declareConstructor<AttachmentAlreadyExpired, {_tag:"AttachmentAlreadyExpired";expiresAt:Utc;repository:string;worker:string; }, readonly [Schema.TaggedStruct<"AttachmentAlreadyExpired", {expiresAt: …;repository: …;worker: …; }>], {_tag:"AttachmentAlreadyExpired";expiresAt:Utc;repository:string&Brand;worker:string&Brand; }>,Schema.TaggedStruct<"AttachmentAlreadyExpired", {expiresAt:Schema.DateTimeUtc;repository:Schema.brand<Schema.String,"RepositoryName">;worker:Schema.brand<Schema.String,"WorkerName">; }>,never,never>>,AdminAuthorization,never> |HttpApiEndpoint.HttpApiEndpoint<"detach","DELETE","/v1/attachments/:id",Schema.toCodecStringTree<Schema.Struct<{id:Schema.brand<Schema.String,"AttachmentId">; }>>,never,never,never,Schema.toCodecJson<typeofDetached>,never,AdminAuthorization,never> |HttpApiEndpoint.HttpApiEndpoint<"list","GET","/v1/attachments",never,never,never,never,Schema.toCodecJson<typeofAttachmentList>,never,AdminAuthorization,never> |HttpApiEndpoint.HttpApiEndpoint<"renew","PUT","/v1/attachments/:id",Schema.toCodecStringTree<Schema.Struct<{id:Schema.brand<Schema.String,"AttachmentId">; }>>,never,Schema.toCodecJson<Schema.decodeTo<Schema.declareConstructor<AttachRequest, {credential: {_tag:"InstallationCredential";token:Redacted; } | {_tag:"AnonymousCredential"; };expiresAt:Utc;repository:string;worker:string; }, readonly [Schema.Struct<{credential: …;expiresAt: …;repository: …;worker: …; }>], {credential: {_tag:"InstallationCredential";token:Redacted; } | {_tag:"AnonymousCredential"; };expiresAt:Utc;repository:string&Brand;worker:string&Brand; }>,Schema.Struct<{credential:Schema.Union<readonly […, …]>;expiresAt:Schema.DateTimeUtc;repository:Schema.brand<Schema.String,"RepositoryName">;worker:Schema.brand<Schema.String,"WorkerName">; }>,never,never>>,never,Schema.toCodecJson<typeofAttached>,Schema.toCodecJson<Schema.decodeTo<Schema.declareConstructor<AttachmentAlreadyExpired, {_tag:"AttachmentAlreadyExpired";expiresAt:Utc;repository:string;worker:string; }, readonly [Schema.TaggedStruct<…, …>], {_tag:"AttachmentAlreadyExpired";expiresAt:Utc;repository:string&Brand;worker:string&Brand; }>,Schema.TaggedStruct<"AttachmentAlreadyExpired", {expiresAt:Schema.DateTimeUtc;repository:Schema.brand<Schema.String,"RepositoryName">;worker:Schema.brand<Schema.String,"WorkerName">; }>,never,never> |Schema.decodeTo<Schema.declareConstructor<AttachmentConflict, {_tag:"AttachmentConflict";id:string;repository:string;worker:string; }, readonly [Schema.TaggedStruct<…, …>], {_tag:"AttachmentConflict";id:string&Brand;repository:string&Brand;worker:string&Brand; }>,Schema.TaggedStruct<"AttachmentConflict", {id:Schema.brand<Schema.String,"AttachmentId">;repository:Schema.brand<Schema.String,"RepositoryName">;worker:Schema.brand<Schema.String,"WorkerName">; }>,never,never>>,AdminAuthorization,never>,false>>
The API the executor calls to attach a GitHub credential to a Worker VM for one repository at the start of an Attempt, renew it with the same id before the token expires, and detach it at cleanup. Attachments are in memory: after a gateway restart the executor’s next renewal stores the attachment again under its id, so the Attempt’s caller token stays valid.
References
Section titled “References”AttachmentId
Section titled “AttachmentId”Re-exports AttachmentId
CallerToken
Section titled “CallerToken”Re-exports CallerToken
GATEWAY_TOKEN_HEADER
Section titled “GATEWAY_TOKEN_HEADER”Re-exports GATEWAY_TOKEN_HEADER
InstallationCredential
Section titled “InstallationCredential”Re-exports InstallationCredential