Skip to content

Commit

Permalink
Add more docs around AuthZ and Share filter lists
Browse files Browse the repository at this point in the history
  • Loading branch information
kenany committed Nov 1, 2024
1 parent c7cda41 commit 340ce5a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 8 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Added

- More documentation to AuthZ and Secure Share filter lists.

### Fixed

- Secure Share: share link list filter now uses "target_id" instead of "target".

## 4.1.0 - 2024-10-16

### Added
Expand Down
14 changes: 10 additions & 4 deletions pangea-sdk/service/authz/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,26 +83,32 @@ func NewFilterUserList() *TupleListFilter {
}
}

// Only records where resource type equals this value.
func (fu *TupleListFilter) ResourceType() *pangea.FilterMatch[string] {
return fu.resourceType
}

// Only records where resource id equals this value.
func (fu *TupleListFilter) ResourceID() *pangea.FilterMatch[string] {
return fu.resourceID
}

// Only records where subject type equals this value.
func (fu *TupleListFilter) SubjectType() *pangea.FilterMatch[string] {
return fu.subjectType
}

// Only records where subject id equals this value.
func (fu *TupleListFilter) SubjectID() *pangea.FilterMatch[string] {
return fu.subjectID
}

// Only records where subject action equals this value.
func (fu *TupleListFilter) SubjectAction() *pangea.FilterMatch[string] {
return fu.subjectAction
}

// Only records where relation equals this value.
func (fu *TupleListFilter) Relation() *pangea.FilterMatch[string] {
return fu.relation
}
Expand Down Expand Up @@ -149,10 +155,10 @@ type TupleListResult struct {
//
// @example
//
// filter := authz.NewFilterUserList()
// filter.ResourceType().Set(pangea.String("folder"))
// filter.ResourceID().Set(pangea.String("folder_id"))

// filter := authz.NewFilterUserList()
// filter.ResourceType().Set(pangea.String("folder"))
// filter.ResourceID().Set(pangea.String("folder_id"))
//
// rListWithResource, err := cli.TupleList(ctx, &authz.TupleListRequest{
// Filter: filter.Filter(),
// })
Expand Down
26 changes: 22 additions & 4 deletions pangea-sdk/service/share/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,38 +371,47 @@ func NewFilterList() *FilterList {
}
}

// Only records where the object exists in the supplied parent folder path name.
func (f *FilterList) Folder() *pangea.FilterEqual[string] {
return f.folder
}

// A list of tags that all must be present.
func (f *FilterList) Tags() *pangea.FilterEqual[[]string] {
return f.tags
}

// Only records where created_at equals this value.
func (f *FilterList) CreatedAt() *pangea.FilterRange[string] {
return f.createdAt
}

// Only records where id equals this value.
func (f *FilterList) ID() *pangea.FilterMatch[string] {
return f.id
}

// Only records where name equals this value.
func (f *FilterList) Name() *pangea.FilterMatch[string] {
return f.name
}

// Only records where parent_id equals this value.
func (f *FilterList) ParentID() *pangea.FilterMatch[string] {
return f.parentId
}

// Only records where size equals this value.
func (f *FilterList) Size() *pangea.FilterRange[string] {
return f.size
}

// Only records where type equals this value.
func (f *FilterList) Type() *pangea.FilterMatch[string] {
return f.type_
}

// Only records where updated_at equals this value.
func (f *FilterList) UpdatedAt() *pangea.FilterRange[string] {
return f.updatedAt
}
Expand Down Expand Up @@ -575,7 +584,7 @@ func (e *share) ShareLinkGet(ctx context.Context, input *ShareLinkGetRequest) (*
type FilterShareLinkList struct {
pangea.FilterBase
id *pangea.FilterMatch[string]
target *pangea.FilterMatch[string]
targetId *pangea.FilterMatch[string]
linkType *pangea.FilterMatch[string]
accessCount *pangea.FilterRange[string]
maxAccessCount *pangea.FilterRange[string]
Expand All @@ -590,7 +599,7 @@ func NewFilterShareLinkList() *FilterShareLinkList {
return &FilterShareLinkList{
FilterBase: *pangea.NewFilterBase(filter),
id: pangea.NewFilterMatch[string]("id", &filter),
target: pangea.NewFilterMatch[string]("target", &filter),
targetId: pangea.NewFilterMatch[string]("target_id", &filter),
linkType: pangea.NewFilterMatch[string]("link_type", &filter),
accessCount: pangea.NewFilterRange[string]("access_count", &filter),
maxAccessCount: pangea.NewFilterRange[string]("max_access_count", &filter),
Expand All @@ -601,38 +610,47 @@ func NewFilterShareLinkList() *FilterShareLinkList {
}
}

// Only records where id equals this value.
func (f *FilterShareLinkList) ID() *pangea.FilterMatch[string] {
return f.id
}

func (f *FilterShareLinkList) Target() *pangea.FilterMatch[string] {
return f.target
// Only records where target_id equals this value.
func (f *FilterShareLinkList) TargetID() *pangea.FilterMatch[string] {
return f.targetId
}

// Only records where link_type equals this value.
func (f *FilterShareLinkList) LinkType() *pangea.FilterMatch[string] {
return f.linkType
}

// Only records where link equals this value.
func (f *FilterShareLinkList) Link() *pangea.FilterMatch[string] {
return f.link
}

// Only records where access_count equals this value.
func (f *FilterShareLinkList) AccessCount() *pangea.FilterRange[string] {
return f.accessCount
}

// Only records where max_access_count equals this value.
func (f *FilterShareLinkList) MaxAccessCount() *pangea.FilterRange[string] {
return f.maxAccessCount
}

// Only records where created_at equals this value.
func (f *FilterShareLinkList) CreatedAt() *pangea.FilterRange[string] {
return f.createdAt
}

// Only records where expires_at equals this value.
func (f *FilterShareLinkList) ExpiresAt() *pangea.FilterRange[string] {
return f.expiresAt
}

// Only records where last_accessed_at equals this value.
func (f *FilterShareLinkList) LastAccessedAt() *pangea.FilterRange[string] {
return f.lastAccessedAt
}
Expand Down

0 comments on commit 340ce5a

Please sign in to comment.