This repository has been archived by the owner on Apr 9, 2024. It is now read-only.
forked from external-secrets/external-secrets
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitHub provider (supersedes external-secrets#3014) (external-secrets#…
…3115) * github provider signed, supersedes external-secrets#3014 Signed-off-by: Mike Serchenia <michael_serchenia@epam.com> * tests pass, + crd + docs Signed-off-by: Mike Serchenia <michael_serchenia@epam.com> * fix sonarLint alert Signed-off-by: Mike Serchenia <michael_serchenia@epam.com> * refactoring, replace secretStore with generator Signed-off-by: Mike Serchenia <michael_serchenia@epam.com> * cosmetics + tst + lint pass Signed-off-by: Mike Serchenia <michael_serchenia@epam.com> * docs Signed-off-by: Mike Serchenia <michael_serchenia@epam.com> * clean-up + lint + test Signed-off-by: Mike Serchenia <michael_serchenia@epam.com> * small refactor, fix issues left in comments Signed-off-by: Mike Serchenia <michael_serchenia@epam.com> --------- Signed-off-by: Mike Serchenia <michael_serchenia@epam.com>
- Loading branch information
1 parent
ecbbdf4
commit 8473161
Showing
13 changed files
with
764 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1alpha1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
|
||
esmeta "github.com/external-secrets/external-secrets/apis/meta/v1" | ||
) | ||
|
||
type GithubAccessTokenSpec struct { | ||
// URL configures the Github instance URL. Defaults to /~https://github.com/. | ||
URL string `json:"url,omitempty"` | ||
AppID string `json:"appID"` | ||
InstallID string `json:"installID"` | ||
// Auth configures how ESO authenticates with a Github instance. | ||
Auth GithubAuth `json:"auth"` | ||
} | ||
|
||
type GithubAuth struct { | ||
PrivatKey GithubSecretRef `json:"privatKey"` | ||
} | ||
|
||
type GithubSecretRef struct { | ||
SecretRef esmeta.SecretKeySelector `json:"secretRef"` | ||
} | ||
|
||
// GithubAccessToken generates ghs_ accessToken | ||
// +kubebuilder:object:root=true | ||
// +kubebuilder:storageversion | ||
// +kubebuilder:subresource:status | ||
// +kubebuilder:resource:scope=Namespaced,categories={githubaccesstoken},shortName=githubaccesstoken | ||
type GithubAccessToken struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec GithubAccessTokenSpec `json:"spec,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// GithubAccessToken contains a list of ExternalSecret resources. | ||
type GithubAccessTokenList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []GithubAccessToken `json:"items"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
91 changes: 91 additions & 0 deletions
91
config/crds/bases/generators.external-secrets.io_githubaccesstokens.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.14.0 | ||
name: githubaccesstokens.generators.external-secrets.io | ||
spec: | ||
group: generators.external-secrets.io | ||
names: | ||
categories: | ||
- githubaccesstoken | ||
kind: GithubAccessToken | ||
listKind: GithubAccessTokenList | ||
plural: githubaccesstokens | ||
shortNames: | ||
- githubaccesstoken | ||
singular: githubaccesstoken | ||
scope: Namespaced | ||
versions: | ||
- name: v1alpha1 | ||
schema: | ||
openAPIV3Schema: | ||
description: GithubAccessToken generates ghs_ accessToken | ||
properties: | ||
apiVersion: | ||
description: |- | ||
APIVersion defines the versioned schema of this representation of an object. | ||
Servers should convert recognized schemas to the latest internal value, and | ||
may reject unrecognized values. | ||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | ||
type: string | ||
kind: | ||
description: |- | ||
Kind is a string value representing the REST resource this object represents. | ||
Servers may infer this from the endpoint the client submits requests to. | ||
Cannot be updated. | ||
In CamelCase. | ||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
properties: | ||
appID: | ||
type: string | ||
auth: | ||
description: Auth configures how ESO authenticates with a Github instance. | ||
properties: | ||
privatKey: | ||
properties: | ||
secretRef: | ||
description: |- | ||
A reference to a specific 'key' within a Secret resource, | ||
In some instances, `key` is a required field. | ||
properties: | ||
key: | ||
description: |- | ||
The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be | ||
defaulted, in others it may be required. | ||
type: string | ||
name: | ||
description: The name of the Secret resource being referred | ||
to. | ||
type: string | ||
namespace: | ||
description: |- | ||
Namespace of the resource being referred to. Ignored if referent is not cluster-scoped. cluster-scoped defaults | ||
to the namespace of the referent. | ||
type: string | ||
type: object | ||
required: | ||
- secretRef | ||
type: object | ||
required: | ||
- privatKey | ||
type: object | ||
installID: | ||
type: string | ||
url: | ||
description: URL configures the Github instance URL. Defaults to /~https://github.com/. | ||
type: string | ||
required: | ||
- appID | ||
- auth | ||
- installID | ||
type: object | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.