tpl

package
v0.0.0-...-1b5374a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPermission

func CheckPermission(s string) error

CheckPermission ...

func CheckResource

func CheckResource(s string) error

CheckResource ...

func CheckSubject

func CheckSubject(s string) error

CheckSubject ...

func CheckTerm

func CheckTerm(s string) error

CheckTerm ...

func GetPermissionUID

func GetPermissionUID(ps []Permission, p string) string

GetPermissionUID ...

func GetSubjectUID

func GetSubjectUID(ss []Subject, sub string) string

GetSubjectUID ...

Types

type ACCheckPermissions

type ACCheckPermissions struct {
	PermissionBatchAddInput
	Subject          string `json:"subject"`
	WithOrganization bool   `json:"withOrganization"`
	IgnoreScope      bool   `json:"ignoreScope"` // 仅对 Object 权限检查有效
}

ACCheckPermissions ...

func (*ACCheckPermissions) Validate

func (t *ACCheckPermissions) Validate() error

Validate 实现 gear.BodyTemplate

type ACCheckPermissionsInput

type ACCheckPermissionsInput struct {
	Target
	ACCheckPermissions
}

ACCheckPermissionsInput ...

func (*ACCheckPermissionsInput) Validate

func (t *ACCheckPermissionsInput) Validate() error

Validate 实现 gear.BodyTemplate

type ACPermissionPayload

type ACPermissionPayload struct {
	Target
	PermissionEx
}

ACPermissionPayload ...

type ErrorResponseType

type ErrorResponseType = gear.ErrorResponse

ErrorResponseType 定义了标准的 API 接口错误时返回数据模型

type Extensions

type Extensions map[string]interface{}

Extensions ...

func (Extensions) Validate

func (t Extensions) Validate() error

Validate 实现 gear.BodyTemplate

type Member

type Member struct {
	UID     string `json:"uid,omitempty"`
	Subject string `json:"subject"`
	Status  int    `json:"status"`
}

Member ...

type OU

type OU struct {
	UID    string `json:"uid,omitempty"`
	OU     string `json:"ou"`
	Parent string `json:"parent,omitempty"`
	Status int    `json:"status"`
}

OU ...

type Object

type Object struct {
	UID        string `json:"uid,omitempty"`
	TargetID   string `json:"targetId"`
	TargetType string `json:"targetType"`
	Terms      string `json:"terms,omitempty"`
}

Object ...

type ObjectAddPermissionsInput

type ObjectAddPermissionsInput struct {
	Target
	Permissions []string `json:"permissions"`
}

ObjectAddPermissionsInput ...

func (*ObjectAddPermissionsInput) Validate

func (t *ObjectAddPermissionsInput) Validate() error

Validate 实现 gear.BodyTemplate

type Organization

type Organization struct {
	UID    string `json:"uid,omitempty"`
	Org    string `json:"organization"`
	Status int    `json:"status"`
}

Organization ...

type OrganizationAddOUInput

type OrganizationAddOUInput struct {
	OrganizationInput
	OU     string `json:"ou"`
	Parent string `json:"parent"`
	Terms  string `json:"terms"`
}

OrganizationAddOUInput ...

func (*OrganizationAddOUInput) Validate

func (t *OrganizationAddOUInput) Validate() error

Validate 实现 gear.BodyTemplate

type OrganizationBatchAddMemberInput

type OrganizationBatchAddMemberInput struct {
	OrganizationInput
	Subjects []struct {
		Subject
		Terms string `json:"terms"`
	} `json:"subjects"`
}

OrganizationBatchAddMemberInput ...

func (*OrganizationBatchAddMemberInput) Validate

func (t *OrganizationBatchAddMemberInput) Validate() error

Validate 实现 gear.BodyTemplate

type OrganizationBatchAddOUMemberInput

type OrganizationBatchAddOUMemberInput struct {
	OrganizationOUInput
	SubjectsInput
}

OrganizationBatchAddOUMemberInput ...

func (*OrganizationBatchAddOUMemberInput) Validate

Validate 实现 gear.BodyTemplate

type OrganizationInput

type OrganizationInput struct {
	Org string `json:"organization"`
}

OrganizationInput ...

func (*OrganizationInput) Validate

func (t *OrganizationInput) Validate() error

Validate 实现 gear.BodyTemplate

type OrganizationListInput

type OrganizationListInput struct {
	OrganizationInput
	Pagination
}

OrganizationListInput ...

func (*OrganizationListInput) Validate

func (t *OrganizationListInput) Validate() error

Validate 实现 gear.BodyTemplate

type OrganizationListOUMembersInput

type OrganizationListOUMembersInput struct {
	OrganizationInput
	Pagination
	OU string `json:"ou"`
}

OrganizationListOUMembersInput ...

func (*OrganizationListOUMembersInput) Validate

func (t *OrganizationListOUMembersInput) Validate() error

Validate 实现 gear.BodyTemplate

type OrganizationListOUsInput

type OrganizationListOUsInput struct {
	OrganizationInput
	Pagination
	Parent string `json:"parent"`
}

OrganizationListOUsInput ...

func (*OrganizationListOUsInput) Validate

func (t *OrganizationListOUsInput) Validate() error

Validate 实现 gear.BodyTemplate

type OrganizationListSubjectOUsInput

type OrganizationListSubjectOUsInput struct {
	OrganizationListSubjectOrgsInput
	OrganizationInput
}

OrganizationListSubjectOUsInput ...

func (*OrganizationListSubjectOUsInput) Validate

func (t *OrganizationListSubjectOUsInput) Validate() error

Validate 实现 gear.BodyTemplate

type OrganizationListSubjectOrgsInput

type OrganizationListSubjectOrgsInput struct {
	Pagination
	Subject string `json:"subject"`
}

OrganizationListSubjectOrgsInput ...

func (*OrganizationListSubjectOrgsInput) Validate

Validate 实现 gear.BodyTemplate

type OrganizationOUInput

type OrganizationOUInput struct {
	OrganizationInput
	OU string `json:"ou"`
}

OrganizationOUInput ...

func (*OrganizationOUInput) Validate

func (t *OrganizationOUInput) Validate() error

Validate 实现 gear.BodyTemplate

type OrganizationSearchInput

type OrganizationSearchInput struct {
	OrganizationInput
	Pagination
	Term string `json:"term"`
}

OrganizationSearchInput ...

func (*OrganizationSearchInput) Validate

func (t *OrganizationSearchInput) Validate() error

Validate 实现 gear.BodyTemplate

type OrganizationStatusInput

type OrganizationStatusInput struct {
	OrganizationInput
	Status int `json:"status"`
}

OrganizationStatusInput ...

func (*OrganizationStatusInput) Validate

func (t *OrganizationStatusInput) Validate() error

Validate 实现 gear.BodyTemplate

type OrganizationUpdateMemberStatusInput

type OrganizationUpdateMemberStatusInput struct {
	OrganizationStatusInput
	Subject string `json:"subject"`
}

OrganizationUpdateMemberStatusInput ...

func (*OrganizationUpdateMemberStatusInput) Validate

Validate 实现 gear.BodyTemplate

type OrganizationUpdateOUParentInput

type OrganizationUpdateOUParentInput struct {
	OrganizationInput
	OU     string `json:"ou"`
	Parent string `json:"parent"`
}

OrganizationUpdateOUParentInput ...

func (*OrganizationUpdateOUParentInput) Validate

func (t *OrganizationUpdateOUParentInput) Validate() error

Validate 实现 gear.BodyTemplate

type Pagination

type Pagination struct {
	PageToken string `json:"pageToken" query:"pageToken"`
	PageSize  int    `json:"pageSize" query:"pageSize"`
	Skip      int    `json:"skip" query:"skip"`
}

Pagination ...

func (*Pagination) Validate

func (pg *Pagination) Validate() error

Validate ...

type Permission

type Permission struct {
	UID        string `json:"uid,omitempty"`
	Permission string `json:"permission"`
}

Permission ...

type PermissionBatchAddInput

type PermissionBatchAddInput struct {
	Permissions []string `json:"permissions"`
}

PermissionBatchAddInput ...

func (*PermissionBatchAddInput) Validate

func (t *PermissionBatchAddInput) Validate() error

Validate 实现 gear.BodyTemplate

type PermissionDeleteInput

type PermissionDeleteInput struct {
	Permission string `json:"permission"`
}

PermissionDeleteInput ...

func (*PermissionDeleteInput) Validate

func (t *PermissionDeleteInput) Validate() error

Validate 实现 gear.BodyTemplate

type PermissionEx

type PermissionEx struct {
	Permission string     `json:"permission"`
	Extensions Extensions `json:"extensions"`
}

PermissionEx ...

func (*PermissionEx) Validate

func (t *PermissionEx) Validate() error

Validate 实现 gear.BodyTemplate

type PermissionListInput

type PermissionListInput struct {
	Pagination
	ResourcesInput
}

PermissionListInput ...

func (*PermissionListInput) Validate

func (t *PermissionListInput) Validate() error

Validate 实现 gear.BodyTemplate

type ResourcesInput

type ResourcesInput struct {
	Resources []string `json:"resources"`
}

ResourcesInput ...

func (*ResourcesInput) Validate

func (t *ResourcesInput) Validate() error

Validate 实现 gear.BodyTemplate

type ResponseType

type ResponseType struct {
	ErrorResponseType
	SuccessResponseType
}

ResponseType ...

type Scope

type Scope struct {
	UID        string `json:"uid,omitempty"`
	Status     int    `json:"status"`
	TargetID   string `json:"targetId"`
	TargetType string `json:"targetType"`
}

Scope ...

type ScopeListInput

type ScopeListInput struct {
	Pagination
	TargetType string `json:"targetType"`
}

ScopeListInput ...

func (*ScopeListInput) Validate

func (t *ScopeListInput) Validate() error

Validate 实现 gear.BodyTemplate

type ScopeListUnitObjectsInput

type ScopeListUnitObjectsInput struct {
	Pagination
	Scope      Target `json:"scope"`
	TargetType string `json:"targetType"`
}

ScopeListUnitObjectsInput ...

func (*ScopeListUnitObjectsInput) Validate

func (t *ScopeListUnitObjectsInput) Validate() error

Validate 实现 gear.BodyTemplate

type ScopeUpdateInput

type ScopeUpdateInput struct {
	Target
	Status int `json:"status"`
}

ScopeUpdateInput ...

func (*ScopeUpdateInput) Validate

func (t *ScopeUpdateInput) Validate() error

Validate 实现 gear.BodyTemplate

type Subject

type Subject struct {
	UID    string `json:"uid,omitempty"`
	Status int    `json:"status"`
	Sub    string `json:"subject"`
}

Subject ...

type SubjectUpdateInput

type SubjectUpdateInput struct {
	Sub    string `json:"subject"`
	Status int    `json:"status"`
}

SubjectUpdateInput ...

func (*SubjectUpdateInput) Validate

func (t *SubjectUpdateInput) Validate() error

Validate 实现 gear.BodyTemplate

type SubjectsInput

type SubjectsInput struct {
	Subjects []string `json:"subjects"`
}

SubjectsInput ...

func (*SubjectsInput) Validate

func (t *SubjectsInput) Validate() error

Validate 实现 gear.BodyTemplate

type SuccessResponseType

type SuccessResponseType struct {
	TotalCount int         `json:"totalCount,omitempty"`
	NextToken  string      `json:"nextToken,omitempty"`
	Result     interface{} `json:"result"`
}

SuccessResponseType 定义了标准的 API 接口成功时返回数据模型

type Target

type Target struct {
	Type string `json:"targetType"`
	ID   string `json:"targetId"`
}

Target ...

func (*Target) Validate

func (t *Target) Validate() error

Validate 实现 gear.BodyTemplate

type TargetBatchAddInput

type TargetBatchAddInput struct {
	Targets []Target `json:"targets"`
	Parent  *Target  `json:"parent"`
	Scope   *Target  `json:"scope"`
}

TargetBatchAddInput ...

func (*TargetBatchAddInput) Validate

func (t *TargetBatchAddInput) Validate() error

Validate 实现 gear.BodyTemplate

type Tenant

type Tenant struct {
	UID    string `json:"uid,omitempty"`
	Tenant string `json:"tenant"`
	Status int    `json:"status"`
}

Tenant ...

type TenantAddInput

type TenantAddInput struct {
	Tenant otgo.OTID `json:"tenant"`
	Status int       `json:"status"`
}

TenantAddInput ...

func (*TenantAddInput) Validate

func (t *TenantAddInput) Validate() error

Validate 实现 gear.BodyTemplate

type Unit

type Unit struct {
	UID        string `json:"uid,omitempty"`
	Status     int    `json:"status"`
	TargetID   string `json:"targetId"`
	TargetType string `json:"targetType"`
}

Unit ...

type UnitAddFromMembersInput

type UnitAddFromMembersInput struct {
	UnitAddInput
	OrganizationInput
	SubjectsInput
}

UnitAddFromMembersInput ...

func (*UnitAddFromMembersInput) Validate

func (t *UnitAddFromMembersInput) Validate() error

Validate 实现 gear.BodyTemplate

type UnitAddFromOUInput

type UnitAddFromOUInput struct {
	UnitAddInput
	OrganizationOUInput
}

UnitAddFromOUInput ...

func (*UnitAddFromOUInput) Validate

func (t *UnitAddFromOUInput) Validate() error

Validate 实现 gear.BodyTemplate

type UnitAddFromOrgInput

type UnitAddFromOrgInput struct {
	UnitAddInput
	OrganizationInput
}

UnitAddFromOrgInput ...

func (*UnitAddFromOrgInput) Validate

func (t *UnitAddFromOrgInput) Validate() error

Validate 实现 gear.BodyTemplate

type UnitAddInput

type UnitAddInput struct {
	Target
	Parent *Target `json:"parent"`
	Scope  *Target `json:"scope"`
}

UnitAddInput ...

func (*UnitAddInput) Validate

func (t *UnitAddInput) Validate() error

Validate 实现 gear.BodyTemplate

type UnitAddPermissionsInput

type UnitAddPermissionsInput struct {
	Target
	Permissions []PermissionEx `json:"permissions"`
}

UnitAddPermissionsInput ...

func (*UnitAddPermissionsInput) Validate

func (t *UnitAddPermissionsInput) Validate() error

Validate 实现 gear.BodyTemplate

type UnitAddSubjectsInput

type UnitAddSubjectsInput struct {
	Target
	SubjectsInput
}

UnitAddSubjectsInput ...

func (*UnitAddSubjectsInput) Validate

func (t *UnitAddSubjectsInput) Validate() error

Validate 实现 gear.BodyTemplate

type UnitAssignObjectInput

type UnitAssignObjectInput struct {
	Target
	Object Target `json:"object"`
}

UnitAssignObjectInput ...

func (*UnitAssignObjectInput) Validate

func (t *UnitAssignObjectInput) Validate() error

Validate 实现 gear.BodyTemplate

type UnitAssignParentInput

type UnitAssignParentInput struct {
	Target
	Parent Target `json:"parent"`
}

UnitAssignParentInput ...

func (*UnitAssignParentInput) Validate

func (t *UnitAssignParentInput) Validate() error

Validate 实现 gear.BodyTemplate

type UnitAssignScopeInput

type UnitAssignScopeInput struct {
	Target
	Scope Target `json:"scope"`
}

UnitAssignScopeInput ...

func (*UnitAssignScopeInput) Validate

func (t *UnitAssignScopeInput) Validate() error

Validate 实现 gear.BodyTemplate

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL