generator_github.go 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.
  11. */
  12. package v1alpha1
  13. import (
  14. metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
  15. esmeta "github.com/external-secrets/external-secrets/apis/meta/v1"
  16. )
  17. type GithubAccessTokenSpec struct {
  18. // URL configures the Github instance URL. Defaults to https://github.com/.
  19. URL string `json:"url,omitempty"`
  20. AppID string `json:"appID"`
  21. InstallID string `json:"installID"`
  22. // Auth configures how ESO authenticates with a Github instance.
  23. Auth GithubAuth `json:"auth"`
  24. }
  25. type GithubAuth struct {
  26. PrivateKey GithubSecretRef `json:"privateKey"`
  27. }
  28. type GithubSecretRef struct {
  29. SecretRef esmeta.SecretKeySelector `json:"secretRef"`
  30. }
  31. // GithubAccessToken generates ghs_ accessToken
  32. // +kubebuilder:object:root=true
  33. // +kubebuilder:storageversion
  34. // +kubebuilder:subresource:status
  35. // +kubebuilder:metadata:labels="external-secrets.io/component=controller"
  36. // +kubebuilder:resource:scope=Namespaced,categories={githubaccesstoken},shortName=githubaccesstoken
  37. type GithubAccessToken struct {
  38. metav1.TypeMeta `json:",inline"`
  39. metav1.ObjectMeta `json:"metadata,omitempty"`
  40. Spec GithubAccessTokenSpec `json:"spec,omitempty"`
  41. }
  42. // +kubebuilder:object:root=true
  43. // GithubAccessToken contains a list of ExternalSecret resources.
  44. type GithubAccessTokenList struct {
  45. metav1.TypeMeta `json:",inline"`
  46. metav1.ListMeta `json:"metadata,omitempty"`
  47. Items []GithubAccessToken `json:"items"`
  48. }