policy.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 (
  16. "time"
  17. "yunion.io/x/onecloud/pkg/apis"
  18. "yunion.io/x/onecloud/pkg/util/tagutils"
  19. )
  20. type SOrganizationNodeInfo struct {
  21. Id string `json:"id"`
  22. FullLabel string `json:"full_label"`
  23. OrgId string `json:"org_id"`
  24. Organization string `json:"organization"`
  25. Tags tagutils.TTagSet `json:"tags"`
  26. Type TOrgType `json:"type"`
  27. }
  28. type PolicyDetails struct {
  29. EnabledIdentityBaseResourceDetails
  30. apis.SharableResourceBaseInfo
  31. SPolicy
  32. OrgNodes []SOrganizationNodeInfo `json:"org_nodes"`
  33. }
  34. type PolicyBindRoleInput struct {
  35. // 角色ID
  36. RoleId string `json:"role_id"`
  37. // 项目ID
  38. ProjectId string `json:"project_id"`
  39. // IP白名单
  40. Ips []string `json:"ips"`
  41. // 权限有效开始时间
  42. ValidSince time.Time `json:"valid_since"`
  43. // 权限有效结束时间
  44. ValidUntil time.Time `json:"valid_until"`
  45. }