credential.go 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // Copyright 2019 Yunion
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package identity
  15. import "yunion.io/x/onecloud/pkg/apis"
  16. type CredentialDetails struct {
  17. apis.StandaloneResourceDetails
  18. SCredential
  19. Blob string `json:"blob"`
  20. User string `json:"user"`
  21. Domain string `json:"domain"`
  22. DomainId string `json:"domain_id"`
  23. }
  24. type CredentialUpdateInput struct {
  25. apis.StandaloneResourceBaseUpdateInput
  26. // enabled
  27. Enabled *bool `json:"enabled"`
  28. // 更新 blob 内容(明文,服务端加密后写入 encrypted_blob)
  29. Blob string `json:"blob"`
  30. // 由 ValidateUpdateData 在提供 blob 时填充,不允许客户端直接传入
  31. EncryptedBlob string `json:"encrypted_blob"`
  32. KeyHash string `json:"key_hash"`
  33. }
  34. type CredentialCreateInput struct {
  35. apis.StandaloneResourceCreateInput
  36. Type string `json:"type"`
  37. ProjectId string `json:"project_id"`
  38. UserId string `json:"user_id"`
  39. Blob string `json:"blob"`
  40. // Ignore
  41. EncryptedBlob string `json:"encrypted_blob"`
  42. // Ignore
  43. KeyHash string `json:"key_hash"`
  44. }
  45. type CredentialContainerImageBlob struct {
  46. Username string `json:"username"`
  47. Password string `json:"password"`
  48. Auth string `json:"auth"`
  49. ServerAddress string `json:"server_address,omitempty"`
  50. // IdentityToken is used to authenticate the user and get
  51. // an access token for the registry.
  52. IdentityToken string `json:"identity_token,omitempty"`
  53. // RegistryToken is a bearer token to be sent to a registry
  54. RegistryToken string `json:"registry_token,omitempty"`
  55. }