Skip to content

Commit

Permalink
chore: rename PrivateToken providerConfigType to PersonalAccessToken …
Browse files Browse the repository at this point in the history
…to aline with gitlab's naming instead of third party library naming
  • Loading branch information
lacroi-m-insta committed Sep 16, 2024
1 parent 0c34e97 commit a3e6f07
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
baseURL: https://gitlab.com/
credentials:
source: Secret
method: PrivateToken
method: PersonalAccessToken
secretRef:
namespace: crossplane-system
name: gitlab-credentials
Expand Down
12 changes: 6 additions & 6 deletions apis/v1beta1/providerconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ import (
)

const (
// BasicAuth gitlab BasicAuth method of authentification
// BasicAuth is gitlab's BasicAuth method of authentification that needs a username and a password
BasicAuth AuthType = "BasicAuth"

// JobToken gitlab JobToken method of authentification
// JobToken is gitlab's JobToken method of authentification
JobToken AuthType = "JobToken"

// OAuthToken gitlab OAuthToken method of authentification
// OAuthToken is gitlab's OAuthToken method of authentification
OAuthToken AuthType = "OAuthToken"

// PrivateToken gitlab PrivateToken method of authentification.
PrivateToken AuthType = "PrivateToken"
// PersonalAccessToken is gitlab's PersonalAccessToken method of authentification.
PersonalAccessToken AuthType = "PersonalAccessToken"
)

// AuthType represents an authentication type within GitLab.
Expand All @@ -57,7 +57,7 @@ type ProviderCredentials struct {
// +kubebuilder:validation:Enum=None;Secret;InjectedIdentity;Environment;Filesystem
Source xpv1.CredentialsSource `json:"source"`

// Method of authentification can be BasicAuth, JobToken, OAuthToken or PrivateToken (default)
// Method of authentification can be BasicAuth, JobToken, OAuthToken or PersonalAccessToken (default)
// +optional
Method AuthType `json:"method"`

Expand Down
2 changes: 1 addition & 1 deletion examples/providerconfig/provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
baseURL: https://gitlab.com/
credentials:
source: Secret
method: PrivateToken
method: PersonalAccessToken
secretRef:
namespace: crossplane-system
name: gitlab-credentials
Expand Down
2 changes: 1 addition & 1 deletion package/crds/gitlab.crossplane.io_providerconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ spec:
type: object
method:
description: Method of authentification can be BasicAuth, JobToken,
OAuthToken or PrivateToken (default)
OAuthToken or PersonalAccessToken (default)
type: string
secretRef:
description: |-
Expand Down
2 changes: 1 addition & 1 deletion pkg/clients/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func NewClient(c Config) *gitlab.Client {
cl, err = gitlab.NewJobClient(c.Token, options...)
case v1beta1.OAuthToken:
cl, err = gitlab.NewOAuthClient(c.Token, options...)
case v1beta1.PrivateToken:
case v1beta1.PersonalAccessToken:
cl, err = gitlab.NewClient(c.Token, options...)
default:
cl, err = gitlab.NewClient(c.Token, options...)
Expand Down

0 comments on commit a3e6f07

Please sign in to comment.