Documentation
¶
Index ¶
- Constants
- Variables
- func AddNamespaceHeaders(ctx context.Context, headers *http.Header)
- func AnonymousCall(ctx context.Context, endpoint ResolveFunc, method string, req interface{}, ...) error
- func AuthenticatedCall(ctx context.Context, endpoint ResolveFunc, method string, req interface{}, ...) error
- func DecodeJSONResponse(resp any) func(io.Reader) error
- func FetchToken(ctx context.Context) (*localauth.Token, error)
- func ImpersonateFromSpec(ctx context.Context, spec ImpersonationSpec, tenantId string) (*localauth.Token, error)
- func IssueDevelopmentToken(ctx context.Context) (string, error)
- func IssueSessionClientCertFromSession(ctx context.Context, sessionToken string, publicKeyPem string) (string, error)
- func IssueTenantClientCertFromToken(ctx context.Context, token Token, publicKey string) (string, error)
- func IssueTenantTokenFromSession(ctx context.Context, t *auth.Token, duration time.Duration) (string, error)
- func IssueToken(ctx context.Context, minDur time.Duration) (string, error)
- func Map(ctx context.Context, fqdn, target string) error
- func ResolveGlobalEndpoint(ctx context.Context, tok ResolvedToken) (string, error)
- func ResolveIAMEndpoint(ctx context.Context, tok ResolvedToken) (string, error)
- func ResolveSpec() (string, error)
- func SetupFlags(flags *pflag.FlagSet)
- func TrustAWSCognitoJWT(ctx context.Context, tenantID, identityPool, identityProvider string) error
- func UpdateTrustRelationships(ctx context.Context, generation string, ...) error
- func VerifySession(ctx context.Context, t Token) error
- type AllocateOpts
- type Artifact
- type BaseImage
- type Call
- type CompleteLoginRequest
- type CompleteTenantLoginResponse
- type ExchangeAWSCognitoJWTRequest
- type ExchangeCircleciTokenRequest
- type ExchangeCircleciTokenResponse
- type ExchangeGithubTokenRequest
- type ExchangeGithubTokenResponse
- type ExchangeOIDCTokenRequest
- type ExchangeTenantTokenForClientCertRequest
- type ExchangeTenantTokenForClientCertResponse
- type ExchangeTokenResponse
- type GetLatestDeployPlansRequest
- type GetLatestDeployPlansResponse
- type GetLatestDeployPlansResponse_Plan
- type GetLatestPrebuiltsRequest
- type GetLatestPrebuiltsResponse
- type GetLatestPrebuiltsResponse_Prebuilt
- type GetLatestResponse
- type GetTenantResponse
- type ImpersonationSpec
- type IssueDevelopmentTokenResponse
- type IssueIdTokenRequest
- type IssueIdTokenResponse
- type IssueIngressAccessTokenRequest
- type IssueIngressAccessTokenResponse
- type IssueRequest
- type IssueResponse
- type IssueSessionClientCertFromSessionRequest
- type IssueSessionClientCertFromSessionResponse
- type IssueTenantTokenFromSessionRequest
- type IssueTenantTokenFromSessionResponse
- type ListBaseImagesRequest
- type ListBaseImagesRequest_Filter
- type ListBaseImagesResponse
- type ListBaseImagesResponse_RunnerBaseImage
- type ListTrustRelationshipsResponse
- type MapRequest
- type MapResponse
- type NSRequirements
- type NameCertificate
- type NameRequest
- type NameResource
- type ResolveFunc
- type ResolvedToken
- type ResourceID
- type RunnerImageDescription
- type StartLoginRequest
- type StartLoginResponse
- type StoredTrustRelationship
- type StringMatcher
- type StringMatcher_Operator
- type Tenant
- type Token
- type TrustAWSCognitoIdentityPoolRequest
- type UpdateTrustRelationshipsRequest
Constants ¶
View Source
const AdminScope = "admin"
Variables ¶
View Source
var ( AdminMode = false DebugApiResponse = false UserAgent = "ns/unknown" )
View Source
var NamingForceStored = false
Functions ¶
func AddNamespaceHeaders ¶ added in v0.0.82
func AnonymousCall ¶
func AnonymousCall(ctx context.Context, endpoint ResolveFunc, method string, req interface{}, handle func(io.Reader) error) error
A nil handle indicates that the caller wants to discard the response.
func AuthenticatedCall ¶ added in v0.0.110
func ImpersonateFromSpec ¶ added in v0.0.424
func IssueDevelopmentToken ¶ added in v0.0.300
func IssueSessionClientCertFromSession ¶ added in v0.0.395
func IssueTenantClientCertFromToken ¶ added in v0.0.395
func IssueTenantTokenFromSession ¶ added in v0.0.314
func IssueToken ¶ added in v0.0.311
func ResolveGlobalEndpoint ¶ added in v0.0.334
func ResolveGlobalEndpoint(ctx context.Context, tok ResolvedToken) (string, error)
func ResolveIAMEndpoint ¶ added in v0.0.334
func ResolveIAMEndpoint(ctx context.Context, tok ResolvedToken) (string, error)
func ResolveSpec ¶ added in v0.0.216
func SetupFlags ¶
func TrustAWSCognitoJWT ¶ added in v0.0.261
func UpdateTrustRelationships ¶ added in v0.0.438
func UpdateTrustRelationships(ctx context.Context, generation string, trustRelationships []StoredTrustRelationship) error
Types ¶
type AllocateOpts ¶
type AllocateOpts struct {
Scope schema.PackageName `json:"-"`
FQDN string `json:"fqdn,omitempty"`
Subdomain string `json:"subdomain,omitempty"`
NoTLS bool `json:"-"`
Org string `json:"org,omitempty"`
Stored *NameResource `json:"-"`
}
JSON annotations below are used for the Arg() serialization below.
type BaseImage ¶ added in v0.0.416
type BaseImage struct {
// Base Image unique identifier.
Id string `json:"id,omitempty"`
// Deprecated. Use id instead.
Ref string `json:"ref,omitempty"`
// Corresponds to InstanceShape.os ("linux" or "macos").
Os string `json:"os,omitempty"`
// E.g. Sonoma, Ubuntu LTS
OsName string `json:"os_name,omitempty"`
// E.g. 14.4.1
OsVersion string `json:"os_version,omitempty"`
// A description used for administration purposes.
Description string `json:"description,omitempty"`
// Set of features that the image supports.
Features []string `json:"features,omitempty"`
}
type Call ¶
type CompleteLoginRequest ¶
type CompleteLoginRequest struct {
LoginId string `json:"login_id"`
}
type CompleteTenantLoginResponse ¶ added in v0.0.180
type CompleteTenantLoginResponse struct {
TenantToken string `json:"tenant_token,omitempty"`
TenantName string `json:"tenant_name,omitempty"`
SessionToken string `json:"session_token,omitempty"`
}
func CompleteTenantLogin ¶ added in v0.0.180
func CompleteTenantLogin(ctx context.Context, id string) (*CompleteTenantLoginResponse, error)
type ExchangeAWSCognitoJWTRequest ¶ added in v0.0.261
type ExchangeCircleciTokenRequest ¶ added in v0.0.244
type ExchangeCircleciTokenRequest struct {
CircleciToken string `json:"circleci_token,omitempty"`
}
type ExchangeCircleciTokenResponse ¶ added in v0.0.244
type ExchangeCircleciTokenResponse struct {
TenantToken string `json:"tenant_token,omitempty"`
Tenant *Tenant `json:"tenant,omitempty"`
}
func ExchangeCircleciToken ¶ added in v0.0.244
func ExchangeCircleciToken(ctx context.Context, token string) (ExchangeCircleciTokenResponse, error)
type ExchangeGithubTokenRequest ¶ added in v0.0.142
type ExchangeGithubTokenRequest struct {
GithubToken string `json:"github_token,omitempty"`
}
type ExchangeGithubTokenResponse ¶ added in v0.0.142
type ExchangeGithubTokenResponse struct {
TenantToken string `json:"tenant_token,omitempty"`
Tenant *Tenant `json:"tenant,omitempty"`
}
func ExchangeGithubToken ¶ added in v0.0.142
func ExchangeGithubToken(ctx context.Context, jwt string) (ExchangeGithubTokenResponse, error)
type ExchangeOIDCTokenRequest ¶ added in v0.0.282
type ExchangeTenantTokenForClientCertRequest ¶ added in v0.0.392
type ExchangeTenantTokenForClientCertRequest struct {
PublicKeyPem string `json:"public_key_pem,omitempty"`
}
type ExchangeTenantTokenForClientCertResponse ¶ added in v0.0.392
type ExchangeTenantTokenForClientCertResponse struct {
ClientCertificatePem string `json:"client_certificate_pem,omitempty"`
}
type ExchangeTokenResponse ¶ added in v0.0.261
type ExchangeTokenResponse struct {
TenantToken string `json:"tenant_token,omitempty"`
Tenant *Tenant `json:"tenant,omitempty"`
}
func ExchangeAWSCognitoJWT ¶ added in v0.0.261
func ExchangeAWSCognitoJWT(ctx context.Context, tenantID, token string) (ExchangeTokenResponse, error)
func ExchangeOIDCToken ¶ added in v0.0.282
func ExchangeOIDCToken(ctx context.Context, tenantID, token string) (ExchangeTokenResponse, error)
type GetLatestDeployPlansRequest ¶ added in v0.0.109
type GetLatestDeployPlansRequest struct {
PackageName []string `json:"package_name,omitempty"`
}
type GetLatestDeployPlansResponse ¶ added in v0.0.109
type GetLatestDeployPlansResponse struct {
Plan []*GetLatestDeployPlansResponse_Plan `json:"plan,omitempty"`
}
func GetLatestDeployPlans ¶ added in v0.0.109
func GetLatestDeployPlans(ctx context.Context, pkgs ...schema.PackageName) (*GetLatestDeployPlansResponse, error)
type GetLatestDeployPlansResponse_Plan ¶ added in v0.0.109
type GetLatestPrebuiltsRequest ¶
type GetLatestPrebuiltsRequest struct {
PackageName []string `json:"package_name,omitempty"`
}
type GetLatestPrebuiltsResponse ¶
type GetLatestPrebuiltsResponse struct {
Prebuilt []*GetLatestPrebuiltsResponse_Prebuilt `json:"prebuilt,omitempty"`
}
func GetLatestPrebuilts ¶
func GetLatestPrebuilts(ctx context.Context, pkgs ...schema.PackageName) (*GetLatestPrebuiltsResponse, error)
type GetLatestResponse ¶
type GetLatestResponse struct {
Version string `json:"version"`
BuildTime time.Time `json:"build_time"`
Tarballs []*Artifact `json:"tarballs"`
}
func GetLatestVersion ¶
type GetTenantResponse ¶ added in v0.0.258
type GetTenantResponse struct {
Tenant *Tenant `json:"tenant,omitempty"`
}
type ImpersonationSpec ¶ added in v0.0.424
type IssueDevelopmentTokenResponse ¶ added in v0.0.300
type IssueDevelopmentTokenResponse struct {
DevelopmentToken string `json:"development_token,omitempty"`
}
type IssueIdTokenRequest ¶ added in v0.0.262
type IssueIdTokenResponse ¶ added in v0.0.262
type IssueIdTokenResponse struct {
IdToken string `json:"id_token,omitempty"`
}
func IssueIdToken ¶ added in v0.0.262
type IssueIngressAccessTokenRequest ¶ added in v0.0.293
type IssueIngressAccessTokenRequest struct {
InstanceId string `json:"instance_id,omitempty"`
}
type IssueIngressAccessTokenResponse ¶ added in v0.0.293
type IssueIngressAccessTokenResponse struct {
IngressAccessToken string `json:"ingress_access_token,omitempty"`
}
func IssueIngressAccessToken ¶ added in v0.0.293
func IssueIngressAccessToken(ctx context.Context, instanceId string) (IssueIngressAccessTokenResponse, error)
type IssueRequest ¶
type IssueRequest struct {
NameRequest NameRequest `json:"name_request"`
Resource NameResource `json:"previous"`
}
type IssueResponse ¶
type IssueResponse struct {
Resource NameResource `json:"resource"`
}
type IssueSessionClientCertFromSessionRequest ¶ added in v0.0.395
type IssueSessionClientCertFromSessionRequest struct {
PublicKeyPem string `json:"public_key_pem,omitempty"`
}
type IssueSessionClientCertFromSessionResponse ¶ added in v0.0.395
type IssueSessionClientCertFromSessionResponse struct {
ClientCertificatePem string `json:"client_certificate_pem,omitempty"`
}
type IssueTenantTokenFromSessionRequest ¶ added in v0.0.311
type IssueTenantTokenFromSessionResponse ¶ added in v0.0.311
type IssueTenantTokenFromSessionResponse struct {
TenantToken string `json:"tenant_token,omitempty"`
}
type ListBaseImagesRequest ¶ added in v0.0.416
type ListBaseImagesRequest struct {
Filter *ListBaseImagesRequest_Filter `json:"filter,omitempty"`
}
type ListBaseImagesRequest_Filter ¶ added in v0.0.416
type ListBaseImagesRequest_Filter struct {
OsLabels *StringMatcher `json:"os_labels,omitempty"`
}
type ListBaseImagesResponse ¶ added in v0.0.416
type ListBaseImagesResponse struct {
Images []*ListBaseImagesResponse_RunnerBaseImage `json:"images,omitempty"`
}
func ListBaseImages ¶ added in v0.0.416
func ListBaseImages(ctx context.Context, osLabel string) (ListBaseImagesResponse, error)
type ListBaseImagesResponse_RunnerBaseImage ¶ added in v0.0.416
type ListBaseImagesResponse_RunnerBaseImage struct {
BaseImage *BaseImage `json:"base_image,omitempty"`
Description *RunnerImageDescription `json:"description,omitempty"`
ImageRef string `json:"image_ref,omitempty"`
}
type ListTrustRelationshipsResponse ¶ added in v0.0.438
type ListTrustRelationshipsResponse struct {
Generation string `json:"generation"`
TrustRelationships []StoredTrustRelationship `json:"trust_relationships,omitempty"`
}
func ListTrustRelationships ¶ added in v0.0.438
func ListTrustRelationships(ctx context.Context) (ListTrustRelationshipsResponse, error)
type MapRequest ¶
type MapResponse ¶
type MapResponse struct {
FQDN string `json:"fqdn"`
}
type NSRequirements ¶
type NSRequirements struct {
MinimumApi int32 `json:"minimum_api"`
}
type NameCertificate ¶
type NameRequest ¶
type NameResource ¶
type NameResource struct {
ID ResourceID `json:"id"`
Certificate NameCertificate `json:"certificate"`
}
func AllocateName ¶
func AllocateName(ctx context.Context, opts AllocateOpts) (*NameResource, error)
type ResolveFunc ¶ added in v0.0.334
type ResolveFunc func(context.Context, ResolvedToken) (string, error)
type ResolvedToken ¶ added in v0.0.312
func IssueBearerToken ¶ added in v0.0.312
func IssueBearerToken(ctx context.Context) (ResolvedToken, error)
func IssueBearerTokenFromToken ¶ added in v0.0.312
func IssueBearerTokenFromToken(ctx context.Context, tok Token) (ResolvedToken, error)
type ResourceID ¶
type ResourceID struct {
Opaque []byte `json:"opaque"`
}
type RunnerImageDescription ¶ added in v0.0.416
type RunnerImageDescription struct {
// OS label as used by GitHub jobs. (e.g. "ubuntu-22.04" or "ubuntu-22.04-staging")
Label string `json:"label,omitempty"`
// Image purpose, e.g. production, staging
Purpose string `json:"purpose,omitempty"`
// Base image ID
BaseImageId string `json:"base_image_id,omitempty"`
}
type StartLoginRequest ¶
type StartLoginResponse ¶
type StartLoginResponse struct {
LoginId string `json:"login_id"`
LoginUrl string `json:"login_url"`
Kind string `json:"kind"`
}
func StartLogin ¶
func StartLogin(ctx context.Context, tenantId string, sessionDuration time.Duration) (*StartLoginResponse, error)
Returns the URL which the user should open.
type StoredTrustRelationship ¶ added in v0.0.438
type StringMatcher ¶ added in v0.0.416
type StringMatcher struct {
Values []string `json:"values,omitempty"`
Op StringMatcher_Operator `json:"op,omitempty"`
}
type StringMatcher_Operator ¶ added in v0.0.416
type StringMatcher_Operator int32
const ( StringMatcher_OPERATOR_UNKNOWN StringMatcher_Operator = 0 StringMatcher_IS_ANY_OF StringMatcher_Operator = 1 StringMatcher_IS_NOT StringMatcher_Operator = 2 )
type Token ¶ added in v0.0.176
type Token interface {
IsSessionToken() bool
ExpiresAt(context.Context) (time.Time, bool, error)
Claims(context.Context) (*auth.TokenClaims, error)
PreferredRegion(context.Context) (string, error)
IssueToken(context.Context, time.Duration, bool) (string, error)
// This fails if it is not a session token.
ExchangeForSessionClientCert(ctx context.Context, publicKeyPem string, issueFromSession localauth.IssueCertFunc) (string, error)
}
type TrustAWSCognitoIdentityPoolRequest ¶ added in v0.0.261
type UpdateTrustRelationshipsRequest ¶ added in v0.0.438
type UpdateTrustRelationshipsRequest struct {
Generation string `json:"generation"`
TrustRelationships []StoredTrustRelationship `json:"trust_relationships,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.