wiring up the sdk to the new permission mode and access grants list (#432)

This commit is contained in:
Michael Quigley 2024-03-04 16:50:52 -05:00
parent d9019d1ef3
commit 6ba4460eb7
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
2 changed files with 13 additions and 0 deletions

View File

@ -20,6 +20,13 @@ const (
PublicShareMode ShareMode = "public"
)
type PermissionMode string
const (
OpenPermissionMode PermissionMode = "open"
ClosedPermissionMode PermissionMode = "closed"
)
type ShareRequest struct {
Reserved bool
UniqueName string
@ -31,6 +38,8 @@ type ShareRequest struct {
OauthProvider string
OauthEmailAddressPatterns []string
OauthAuthorizationCheckInterval time.Duration
PermissionMode PermissionMode
AccessGrants []string
}
type Share struct {

View File

@ -71,6 +71,8 @@ func newPrivateShare(root env_core.Root, request *ShareRequest) *share.SharePara
BackendMode: string(request.BackendMode),
BackendProxyEndpoint: request.Target,
AuthScheme: string(None),
PermissionMode: string(request.PermissionMode),
AccessGrants: request.AccessGrants,
}
return req
}
@ -87,6 +89,8 @@ func newPublicShare(root env_core.Root, request *ShareRequest) *share.ShareParam
OauthEmailDomains: request.OauthEmailAddressPatterns,
OauthProvider: request.OauthProvider,
OauthAuthorizationCheckInterval: request.OauthAuthorizationCheckInterval.String(),
PermissionMode: string(request.PermissionMode),
AccessGrants: request.AccessGrants,
}
return req
}