aksk_options.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package aksk
  2. // AKSKAuthOptions presents the required information for AK/SK auth
  3. type AKSKOptions struct {
  4. // IdentityEndpoint specifies the HTTP endpoint that is required to work with
  5. // the Identity API of the appropriate version. While it's ultimately needed by
  6. // all of the identity services, it will often be populated by a provider-level
  7. // function.
  8. //
  9. // The IdentityEndpoint is typically referred to as the "auth_url" or
  10. // "OS_AUTH_URL" in the information provided by the cloud operator.
  11. IdentityEndpoint string `json:"-" required:"true"`
  12. // user project id
  13. ProjectID string
  14. DomainID string `json:"-" required:"true"`
  15. // region
  16. Region string
  17. //Cloud name
  18. Domain string
  19. //Cloud name
  20. Cloud string
  21. AccessKey string //Access Key
  22. SecretKey string //Secret key
  23. SecurityToken string
  24. }
  25. // GetIdentityEndpoint,Implements the method of AuthOptionsProvider
  26. func (opts AKSKOptions) GetIdentityEndpoint() string {
  27. return opts.IdentityEndpoint
  28. }
  29. //GetProjectId, Implements the method of AuthOptionsProvider
  30. func (opts AKSKOptions) GetProjectId() string {
  31. return opts.ProjectID
  32. }
  33. // GetDomainId,Implements the method of AuthOptionsProvider
  34. func (opts AKSKOptions) GetDomainId() string {
  35. return opts.DomainID
  36. }