Skip to content

Commit

Permalink
Merge pull request #55 from Benedikt1992/fix_issue_54
Browse files Browse the repository at this point in the history
remove plaintext runner token from observation
  • Loading branch information
janwillies committed Jan 19, 2022
2 parents b029a8c + 90e7ecf commit 7824323
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 16 deletions.
1 change: 0 additions & 1 deletion apis/groups/v1alpha1/group_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ type GroupObservation struct {
FullPath string `json:"fullPath,omitempty"`
Statistics *StorageStatistics `json:"statistics,omitempty"`
CustomAttributes []CustomAttribute `json:"customAttributes,omitempty"`
RunnersToken string `json:"runnersToken,omitempty"`
SharedWithGroups []SharedWithGroups `json:"sharedWithGroups,omitempty"`
LDAPCN string `json:"ldapCn,omitempty"`
LDAPAccess AccessLevelValue `json:"ldapAccess,omitempty"`
Expand Down
1 change: 0 additions & 1 deletion apis/projects/v1alpha1/project_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,6 @@ type ProjectObservation struct {
Permissions *Permissions `json:"permissions,omitempty"`
Public bool `json:"public,omitempty"`
ReadmeURL string `json:"readmeUrl,omitempty"`
RunnersToken string `json:"runnersToken,omitempty"`
SSHURLToRepo string `json:"sshUrlToRepo,omitempty"`
ServiceDeskAddress string `json:"serviceDeskAddress,omitempty"`
SharedWithGroups []SharedWithGroups `json:"sharedWithGroups,omitempty"`
Expand Down
2 changes: 0 additions & 2 deletions package/crds/groups.gitlab.crossplane.io_groups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,6 @@ spec:
markedForDeletionOn:
format: date-time
type: string
runnersToken:
type: string
sharedWithGroups:
items:
description: SharedWithGroups represents a GitLab Shared with groups.
Expand Down
2 changes: 0 additions & 2 deletions package/crds/projects.gitlab.crossplane.io_projects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -627,8 +627,6 @@ spec:
type: boolean
readmeUrl:
type: string
runnersToken:
type: string
serviceDeskAddress:
type: string
sharedWithGroups:
Expand Down
13 changes: 6 additions & 7 deletions pkg/clients/groups/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,12 @@ func GenerateObservation(grp *gitlab.Group) v1alpha1.GroupObservation { // nolin
return v1alpha1.GroupObservation{}
}
group := v1alpha1.GroupObservation{
ID: grp.ID,
AvatarURL: grp.AvatarURL,
WebURL: grp.WebURL,
FullName: grp.FullName,
FullPath: grp.FullPath,
RunnersToken: grp.RunnersToken,
LDAPCN: grp.LDAPCN,
ID: grp.ID,
AvatarURL: grp.AvatarURL,
WebURL: grp.WebURL,
FullName: grp.FullName,
FullPath: grp.FullPath,
LDAPCN: grp.LDAPCN,
}

if grp.CreatedAt != nil {
Expand Down
1 change: 0 additions & 1 deletion pkg/clients/projects/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ func GenerateObservation(prj *gitlab.Project) v1alpha1.ProjectObservation { // n
Archived: prj.Archived,
ForksCount: prj.ForksCount,
StarCount: prj.StarCount,
RunnersToken: prj.RunnersToken,
EmptyRepo: prj.EmptyRepo,
AvatarURL: prj.AvatarURL,
LicenseURL: prj.LicenseURL,
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/groups/group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func TestObserve(t *testing.T) {
withConditions(xpv1.Available()),
withPath(path),
withAnnotations(extNameAnnotation),
withStatus(v1alpha1.GroupObservation{RunnersToken: "token"}),
withStatus(v1alpha1.GroupObservation{}),
),
result: managed.ExternalObservation{
ResourceExists: true,
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/projects/project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ func TestObserve(t *testing.T) {
withConditions(xpv1.Available()),
withPath(&path),
withExternalName(extName),
withStatus(v1alpha1.ProjectObservation{RunnersToken: "token"}),
withStatus(v1alpha1.ProjectObservation{}),
),
result: managed.ExternalObservation{
ResourceExists: true,
Expand Down

0 comments on commit 7824323

Please sign in to comment.