mirror of
https://github.com/openziti/zrok.git
synced 2025-01-18 20:08:21 +01:00
fix missing permission modes and access grants in python sdk (#432)
This commit is contained in:
parent
f1c9f11e4d
commit
f51ca98c47
@ -1,5 +1,9 @@
|
|||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
|
## v0.4.27
|
||||||
|
|
||||||
|
FIX: Also update the Python SDK to include the permission mode and access grants fields on the `ShareRequest` (https://github.com/openziti/zrok/issues/432)
|
||||||
|
|
||||||
## v0.4.26
|
## v0.4.26
|
||||||
|
|
||||||
FEATURE: New _permission modes_ available for shares. _Open permission mode_ retains the behavior of previous zrok releases and is the default setting. _Closed permission mode_ (`--closed`) only allows a share to be accessed (`zrok access`) by users who have been granted access with the `--access-grant` flag. See the documentation at (https://docs.zrok.io/docs/guides/permission-modes/) (https://github.com/openziti/zrok/issues/432)
|
FEATURE: New _permission modes_ available for shares. _Open permission mode_ retains the behavior of previous zrok releases and is the default setting. _Closed permission mode_ (`--closed`) only allows a share to be accessed (`zrok access`) by users who have been granted access with the `--access-grant` flag. See the documentation at (https://docs.zrok.io/docs/guides/permission-modes/) (https://github.com/openziti/zrok/issues/432)
|
||||||
|
@ -13,6 +13,11 @@ ShareMode = str
|
|||||||
PRIVATE_SHARE_MODE: ShareMode = "private"
|
PRIVATE_SHARE_MODE: ShareMode = "private"
|
||||||
PUBLIC_SHARE_MODE: ShareMode = "public"
|
PUBLIC_SHARE_MODE: ShareMode = "public"
|
||||||
|
|
||||||
|
PermissionMode = str
|
||||||
|
|
||||||
|
OPEN_PERMISSION_MODE: PermissionMode = "open"
|
||||||
|
CLOSED_PERMISSION_MODE: PermissionMode = "closed"
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class ShareRequest:
|
class ShareRequest:
|
||||||
@ -26,7 +31,8 @@ class ShareRequest:
|
|||||||
OauthAuthorizationCheckInterval: str = ""
|
OauthAuthorizationCheckInterval: str = ""
|
||||||
Reserved: bool = False
|
Reserved: bool = False
|
||||||
UniqueName: str = ""
|
UniqueName: str = ""
|
||||||
|
PermissionMode: PermissionMode = OPEN_PERMISSION_MODE
|
||||||
|
AccessGrants: list[str] = field(default_factory=list[str])
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Share:
|
class Share:
|
||||||
|
@ -67,7 +67,9 @@ def __newPrivateShare(root: Root, request: model.ShareRequest) -> ShareRequest:
|
|||||||
share_mode=request.ShareMode,
|
share_mode=request.ShareMode,
|
||||||
backend_mode=request.BackendMode,
|
backend_mode=request.BackendMode,
|
||||||
backend_proxy_endpoint=request.Target,
|
backend_proxy_endpoint=request.Target,
|
||||||
auth_scheme=model.AUTH_SCHEME_NONE
|
auth_scheme=model.AUTH_SCHEME_NONE,
|
||||||
|
permission_mode=request.permission_mode,
|
||||||
|
access_grants=request.access_grants
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -79,7 +81,9 @@ def __newPublicShare(root: Root, request: model.ShareRequest) -> ShareRequest:
|
|||||||
backend_proxy_endpoint=request.Target,
|
backend_proxy_endpoint=request.Target,
|
||||||
auth_scheme=model.AUTH_SCHEME_NONE,
|
auth_scheme=model.AUTH_SCHEME_NONE,
|
||||||
oauth_email_domains=request.OauthEmailAddressPatterns,
|
oauth_email_domains=request.OauthEmailAddressPatterns,
|
||||||
oauth_authorization_check_interval=request.OauthAuthorizationCheckInterval
|
oauth_authorization_check_interval=request.OauthAuthorizationCheckInterval,
|
||||||
|
permission_mode=request.permission_mode,
|
||||||
|
access_grants=request.access_grants
|
||||||
)
|
)
|
||||||
if request.OauthProvider != "":
|
if request.OauthProvider != "":
|
||||||
ret.oauth_provider = request.OauthProvider
|
ret.oauth_provider = request.OauthProvider
|
||||||
|
Loading…
Reference in New Issue
Block a user