2
0

gitlab.go 992 B

123456789101112131415161718192021222324252627282930313233343536
  1. package integrations
  2. import (
  3. "github.com/porter-dev/porter/api/types"
  4. "gorm.io/gorm"
  5. )
  6. // GitlabIntegration takes care of Gitlab app related data
  7. type GitlabIntegration struct {
  8. gorm.Model
  9. // Project ID of the project that this gitlab integration is linked with
  10. ProjectID uint `json:"project_id"`
  11. // URL of the Gitlab instance to talk to
  12. InstanceURL string `json:"instance_url"`
  13. // ------------------------------------------------------------------
  14. // All fields encrypted before storage.
  15. // ------------------------------------------------------------------
  16. // Gitlab instance-wide app's client ID
  17. AppClientID []byte `json:"app_client_id"`
  18. // Gitlab instance-wide app's client secret
  19. AppClientSecret []byte `json:"app_client_secret"`
  20. }
  21. func (gi *GitlabIntegration) ToGitlabIntegrationType() *types.GitlabIntegration {
  22. return &types.GitlabIntegration{
  23. CreatedAt: gi.CreatedAt,
  24. ID: gi.ID,
  25. ProjectID: gi.ProjectID,
  26. InstanceURL: gi.InstanceURL,
  27. }
  28. }