mirror of
https://github.com/openziti/zrok.git
synced 2024-11-21 23:53:19 +01:00
wiring up the sdk to the new permission mode and access grants list (#432)
This commit is contained in:
parent
d9019d1ef3
commit
6ba4460eb7
@ -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 {
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user