Documentation
¶
Overview ¶
Package vcsprovider is responsible for VCS providers
templ: version: v0.3.865
Index ¶
- Constants
- func RepoURL(provider *VCSProvider, repo string) templ.SafeURL
- func VCSIcon(provider *VCSProvider) templ.Component
- type CreateOptions
- type ListOptions
- type Options
- type Service
- func (a *Service) AddHandlers(r *mux.Router)
- func (a *Service) BeforeDeleteVCSProvider(hook func(context.Context, *VCSProvider) error)
- func (a *Service) Create(ctx context.Context, opts CreateOptions) (*VCSProvider, error)
- func (a *Service) Delete(ctx context.Context, id resource.TfeID) (*VCSProvider, error)
- func (a *Service) Get(ctx context.Context, id resource.TfeID) (*VCSProvider, error)
- func (a *Service) GetVCSClient(ctx context.Context, providerID resource.TfeID) (vcs.Client, error)
- func (a *Service) List(ctx context.Context, organization organization.Name) ([]*VCSProvider, error)
- func (a *Service) ListAllVCSProviders(ctx context.Context) ([]*VCSProvider, error)
- func (a *Service) ListVCSProvidersByGithubAppInstall(ctx context.Context, installID int64) ([]*VCSProvider, error)
- func (a *Service) Update(ctx context.Context, id resource.TfeID, opts UpdateOptions) (*VCSProvider, error)
- type TFEOAuthClient
- type TFEOAuthClientCreateOptions
- type TFEOAuthToken
- type TFEServiceProviderType
- type Table
- type UpdateOptions
- type VCSProvider
Constants ¶
const ( GithubAPIURL = "https://api.github.com" GithubHTTPURL = "https://github.com" )
Variables ¶
This section is empty.
Functions ¶
func VCSIcon ¶ added in v0.3.19
func VCSIcon(provider *VCSProvider) templ.Component
Types ¶
type CreateOptions ¶
type ListOptions ¶ added in v0.3.17
type ListOptions struct {
resource.PageOptions
Organization organization.Name `schema:"organization_name"`
}
type Service ¶
type Service struct {
logr.Logger
*authz.Authorizer
*internal.HostnameService
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) AddHandlers ¶ added in v0.2.2
func (*Service) BeforeDeleteVCSProvider ¶ added in v0.1.8
func (a *Service) BeforeDeleteVCSProvider(hook func(context.Context, *VCSProvider) error)
func (*Service) Create ¶ added in v0.2.2
func (a *Service) Create(ctx context.Context, opts CreateOptions) (*VCSProvider, error)
func (*Service) GetVCSClient ¶
func (*Service) List ¶ added in v0.2.2
func (a *Service) List(ctx context.Context, organization organization.Name) ([]*VCSProvider, error)
func (*Service) ListAllVCSProviders ¶ added in v0.0.53
func (a *Service) ListAllVCSProviders(ctx context.Context) ([]*VCSProvider, error)
func (*Service) ListVCSProvidersByGithubAppInstall ¶ added in v0.1.14
func (a *Service) ListVCSProvidersByGithubAppInstall(ctx context.Context, installID int64) ([]*VCSProvider, error)
ListVCSProvidersByGithubAppInstall is unauthenticated: only for internal use.
func (*Service) Update ¶ added in v0.2.2
func (a *Service) Update(ctx context.Context, id resource.TfeID, opts UpdateOptions) (*VCSProvider, error)
type TFEOAuthClient ¶ added in v0.3.17
type TFEOAuthClient struct {
ID resource.TfeID `jsonapi:"primary,oauth-clients"`
APIURL string `jsonapi:"attribute" json:"api-url"`
CallbackURL string `jsonapi:"attribute" json:"callback-url"`
ConnectPath string `jsonapi:"attribute" json:"connect-path"`
CreatedAt time.Time `jsonapi:"attribute" json:"created-at"`
HTTPURL string `jsonapi:"attribute" json:"http-url"`
Key string `jsonapi:"attribute" json:"key"`
RSAPublicKey string `jsonapi:"attribute" json:"rsa-public-key"`
Name *string `jsonapi:"attribute" json:"name"`
Secret string `jsonapi:"attribute" json:"secret"`
ServiceProvider TFEServiceProviderType `jsonapi:"attribute" json:"service-provider"`
ServiceProviderName string `jsonapi:"attribute" json:"service-provider-display-name"`
// Relations
Organization *organization.TFEOrganization `jsonapi:"relationship" json:"organization"`
OAuthTokens []*TFEOAuthToken `jsonapi:"relationship" json:"oauth-tokens"`
}
TFEOAuthClient represents a connection between an organization and a VCS provider.
type TFEOAuthClientCreateOptions ¶ added in v0.3.17
type TFEOAuthClientCreateOptions struct {
// Type is a public field utilized by JSON:API to
// set the resource type via the field tag.
// It is not a user-defined value and does not need to be set.
// https://jsonapi.org/format/#crud-creating
Type string `jsonapi:"primary,oauth-clients"`
// A display name for the OAuth Client.
Name *string `jsonapi:"attribute" json:"name"`
// Required: The base URL of your VCS provider's API.
APIURL *string `jsonapi:"attribute" json:"api-url"`
// Required: The homepage of your VCS provider.
HTTPURL *string `jsonapi:"attribute" json:"http-url"`
// Optional: The OAuth Client key.
Key *string `jsonapi:"attribute" json:"key,omitempty"`
// Optional: The token string you were given by your VCS provider.
OAuthToken *string `jsonapi:"attribute" json:"oauth-token-string,omitempty"`
// Optional: Private key associated with this vcs provider - only available for ado_server
PrivateKey *string `jsonapi:"attribute" json:"private-key,omitempty"`
// Optional: Secret key associated with this vcs provider - only available for ado_server
Secret *string `jsonapi:"attribute" json:"secret,omitempty"`
// Optional: RSAPublicKey the text of the SSH public key associated with your BitBucket
// Server Application Link.
RSAPublicKey *string `jsonapi:"attribute" json:"rsa-public-key,omitempty"`
// Required: The VCS provider being connected with.
ServiceProvider *TFEServiceProviderType `jsonapi:"attribute" json:"service-provider"`
}
TFEOAuthClientCreateOptions represents the options for creating an OAuth client.
type TFEOAuthToken ¶ added in v0.3.17
type TFEOAuthToken struct {
ID resource.TfeID `jsonapi:"primary,oauth-tokens"`
UID resource.TfeID `jsonapi:"attribute" json:"uid"`
CreatedAt time.Time `jsonapi:"attribute" json:"created-at"`
HasSSHKey bool `jsonapi:"attribute" json:"has-ssh-key"`
ServiceProviderUser string `jsonapi:"attribute" json:"service-provider-user"`
// Relations
OAuthClient *TFEOAuthClient `jsonapi:"relationship" json:"oauth-client"`
}
TFEOAuthToken represents a VCS configuration including the associated OAuth token
type TFEServiceProviderType ¶ added in v0.3.17
type TFEServiceProviderType string
TFEServiceProviderType represents a VCS type.
const ( ServiceProviderAzureDevOpsServer TFEServiceProviderType = "ado_server" ServiceProviderAzureDevOpsServices TFEServiceProviderType = "ado_services" ServiceProviderBitbucket TFEServiceProviderType = "bitbucket_hosted" // Bitbucket Server v5.4.0 and above ServiceProviderBitbucketServer TFEServiceProviderType = "bitbucket_server" // Bitbucket Server v5.3.0 and below ServiceProviderBitbucketServerLegacy TFEServiceProviderType = "bitbucket_server_legacy" ServiceProviderGithub TFEServiceProviderType = "github" ServiceProviderGithubEE TFEServiceProviderType = "github_enterprise" ServiceProviderGitlab TFEServiceProviderType = "gitlab_hosted" ServiceProviderGitlabCE TFEServiceProviderType = "gitlab_community_edition" ServiceProviderGitlabEE TFEServiceProviderType = "gitlab_enterprise_edition" )
List of available VCS types.
type UpdateOptions ¶ added in v0.1.11
type VCSProvider ¶
type VCSProvider struct {
ID resource.TfeID
Name string
CreatedAt time.Time
Organization organization.Name // name of OTF organization
Hostname string // hostname of github/gitlab etc
Kind vcs.Kind // github/gitlab etc. Not necessary if GithubApp is non-nil.
Token *string // personal access token.
GithubApp *github.InstallCredentials // mutually exclusive with Token.
// contains filtered or unexported fields
}
VCSProvider provides authenticated access to a VCS.
func (*VCSProvider) LogValue ¶
func (t *VCSProvider) LogValue() slog.Value
LogValue implements slog.LogValuer.
func (*VCSProvider) String ¶
func (t *VCSProvider) String() string
String provides a human meaningful description of the vcs provider, using the name if set; otherwise a name is constructed using both the underlying cloud kind and the auth kind.
func (*VCSProvider) Update ¶ added in v0.1.11
func (t *VCSProvider) Update(opts UpdateOptions) error