resources

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceAccountBasic = "client_secret_basic"
	ServiceAccountJWT   = "private_key_jwt"

	ServiceAccountRoleGuest        = ServiceAccountRole("guest")
	ServiceAccountRoleReporter     = ServiceAccountRole("reporter")
	ServiceAccountRoleDeveloper    = ServiceAccountRole("developer")
	ServiceAccountRoleMaintainer   = ServiceAccountRole("maintainer")
	ServiceAccountRoleProjectAdmin = ServiceAccountRole("project-admin")
	ServiceAccountRoleCompanyOwner = ServiceAccountRole("company-owner")
)

Variables

This section is empty.

Functions

func EncodeResourceToJSON

func EncodeResourceToJSON(obj interface{}) ([]byte, error)

func IsValidServiceAccountRole

func IsValidServiceAccountRole(role ServiceAccountRole) bool

Types

type APIError

type APIError struct {
	StatusCode int    `json:"statusCode"`
	Message    string `json:"message"`
}

type AuthProvider

type AuthProvider struct {
	ID    string `json:"id"`
	Label string `json:"label"`
	Type  string `json:"type"`
}

type Cluster

type Cluster struct {
	Hostname  string `json:"hostname"`
	Namespace string `json:"namespace"`
}

type Company

type Company struct {
	ID         string     `json:"_id"` //nolint:tagliatelle
	Name       string     `json:"name"`
	TenantID   string     `json:"tenantId"`
	Pipelines  Pipelines  `json:"pipelines"`
	Repository Repository `json:"repository"`
}

type DeployProject

type DeployProject struct {
	ID  int    `json:"id"`
	URL string `json:"url"`
}

type DeployProjectRequest

type DeployProjectRequest struct {
	Environment string `json:"environment"`
	Revision    string `json:"revision"`
	Type        string `json:"deployType"`              //nolint: tagliatelle
	ForceDeploy bool   `json:"forceDeplpuWhenNoSemver"` //nolint: tagliatelle
}

type Environment

type Environment struct {
	DisplayName string  `json:"label"` //nolint:tagliatelle
	EnvID       string  `json:"value"` //nolint:tagliatelle
	Cluster     Cluster `json:"cluster"`
}

type JWTServiceAccountJSON added in v0.7.0

type JWTServiceAccountJSON struct {
	Type           string `json:"type"`
	KeyID          string `json:"key-id"`           //nolint: tagliatelle
	PrivateKeyData string `json:"private-key-data"` //nolint: tagliatelle
	ClientID       string `json:"client-id"`        //nolint: tagliatelle
}

type JWTTokenRequest

type JWTTokenRequest struct {
	Code  string `json:"code"`
	State string `json:"state"`
}

type PipelineStatus

type PipelineStatus struct {
	ID     int    `json:"id"`
	Status string `json:"status"`
}

type Pipelines

type Pipelines struct {
	Type string `json:"type"`
}

type Project

type Project struct {
	ID                   string        `json:"_id"` //nolint:tagliatelle
	Name                 string        `json:"name"`
	ConfigurationGitPath string        `json:"configurationGitPath"`
	Environments         []Environment `json:"environments"`
	ProjectID            string        `json:"projectId"`
	Pipelines            Pipelines     `json:"pipelines"`
	TenantID             string        `json:"tenantId"`
}

type PublicKey added in v0.7.0

type PublicKey struct {
	Type      string `json:"kty"` //nolint: tagliatelle
	Use       string `json:"use"` //nolint: tagliatelle
	Algorithm string `json:"alg"` //nolint: tagliatelle
	KeyID     string `json:"kid"` //nolint: tagliatelle
	Modulus   string `json:"n"`   //nolint: tagliatelle
	Exponent  string `json:"e"`   //nolint: tagliatelle
}

type RefreshTokenRequest

type RefreshTokenRequest struct {
	RefreshToken string `json:"refreshToken"`
}

type Repository

type Repository struct {
	Type string `json:"type"`
}

type ServiceAccount added in v0.7.0

type ServiceAccount struct {
	ClientID         string `json:"clientId"`
	ClientSecret     string `json:"clientSecret"`
	ClientIDIssuedAt int64  `json:"clientIdIssuedAt"`
	Company          string `json:"company"`
}

type ServiceAccountRequest

type ServiceAccountRequest struct {
	Name      string             `json:"name"`
	Type      string             `json:"tokenEndpointAuthMethod"` //nolint: tagliatelle
	Role      ServiceAccountRole `json:"role"`
	PublicKey PublicKey          `json:"publicKey,omitempty"`
}

type ServiceAccountRole

type ServiceAccountRole string

func (ServiceAccountRole) String

func (role ServiceAccountRole) String() string

type UserToken

type UserToken struct {
	AccessToken  string `json:"accessToken"`
	RefreshToken string `json:"refreshToken"`
	ExpiresAt    int64  `json:"expiresAt"`
}

func (*UserToken) JWTToken

func (ut *UserToken) JWTToken() *oauth2.Token

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL