mirror of
https://github.com/openziti/zrok.git
synced 2025-06-19 17:27:54 +02:00
updated api spec to support permission mode and access grans (#432)
This commit is contained in:
parent
1e73f185d8
commit
dce32b58d2
@ -21,6 +21,9 @@ import (
|
|||||||
// swagger:model shareRequest
|
// swagger:model shareRequest
|
||||||
type ShareRequest struct {
|
type ShareRequest struct {
|
||||||
|
|
||||||
|
// access grants
|
||||||
|
AccessGrants []string `json:"accessGrants"`
|
||||||
|
|
||||||
// auth scheme
|
// auth scheme
|
||||||
AuthScheme string `json:"authScheme,omitempty"`
|
AuthScheme string `json:"authScheme,omitempty"`
|
||||||
|
|
||||||
@ -50,6 +53,10 @@ type ShareRequest struct {
|
|||||||
// Enum: [github google]
|
// Enum: [github google]
|
||||||
OauthProvider string `json:"oauthProvider,omitempty"`
|
OauthProvider string `json:"oauthProvider,omitempty"`
|
||||||
|
|
||||||
|
// permission mode
|
||||||
|
// Enum: [open closed]
|
||||||
|
PermissionMode string `json:"permissionMode,omitempty"`
|
||||||
|
|
||||||
// reserved
|
// reserved
|
||||||
Reserved bool `json:"reserved,omitempty"`
|
Reserved bool `json:"reserved,omitempty"`
|
||||||
|
|
||||||
@ -77,6 +84,10 @@ func (m *ShareRequest) Validate(formats strfmt.Registry) error {
|
|||||||
res = append(res, err)
|
res = append(res, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := m.validatePermissionMode(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
if err := m.validateShareMode(formats); err != nil {
|
if err := m.validateShareMode(formats); err != nil {
|
||||||
res = append(res, err)
|
res = append(res, err)
|
||||||
}
|
}
|
||||||
@ -212,6 +223,48 @@ func (m *ShareRequest) validateOauthProvider(formats strfmt.Registry) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var shareRequestTypePermissionModePropEnum []interface{}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
var res []string
|
||||||
|
if err := json.Unmarshal([]byte(`["open","closed"]`), &res); err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
for _, v := range res {
|
||||||
|
shareRequestTypePermissionModePropEnum = append(shareRequestTypePermissionModePropEnum, v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
|
||||||
|
// ShareRequestPermissionModeOpen captures enum value "open"
|
||||||
|
ShareRequestPermissionModeOpen string = "open"
|
||||||
|
|
||||||
|
// ShareRequestPermissionModeClosed captures enum value "closed"
|
||||||
|
ShareRequestPermissionModeClosed string = "closed"
|
||||||
|
)
|
||||||
|
|
||||||
|
// prop value enum
|
||||||
|
func (m *ShareRequest) validatePermissionModeEnum(path, location string, value string) error {
|
||||||
|
if err := validate.EnumCase(path, location, value, shareRequestTypePermissionModePropEnum, true); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *ShareRequest) validatePermissionMode(formats strfmt.Registry) error {
|
||||||
|
if swag.IsZero(m.PermissionMode) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// value enum
|
||||||
|
if err := m.validatePermissionModeEnum("permissionMode", "body", m.PermissionMode); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
var shareRequestTypeShareModePropEnum []interface{}
|
var shareRequestTypeShareModePropEnum []interface{}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -1562,6 +1562,12 @@ func init() {
|
|||||||
"shareRequest": {
|
"shareRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"accessGrants": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
"authScheme": {
|
"authScheme": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
@ -1611,6 +1617,13 @@ func init() {
|
|||||||
"google"
|
"google"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"permissionMode": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"open",
|
||||||
|
"closed"
|
||||||
|
]
|
||||||
|
},
|
||||||
"reserved": {
|
"reserved": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
@ -3289,6 +3302,12 @@ func init() {
|
|||||||
"shareRequest": {
|
"shareRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"accessGrants": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
"authScheme": {
|
"authScheme": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
@ -3338,6 +3357,13 @@ func init() {
|
|||||||
"google"
|
"google"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"permissionMode": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"open",
|
||||||
|
"closed"
|
||||||
|
]
|
||||||
|
},
|
||||||
"reserved": {
|
"reserved": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
|
@ -39,6 +39,8 @@ class ShareRequest(object):
|
|||||||
'oauth_email_domains': 'list[str]',
|
'oauth_email_domains': 'list[str]',
|
||||||
'oauth_authorization_check_interval': 'str',
|
'oauth_authorization_check_interval': 'str',
|
||||||
'reserved': 'bool',
|
'reserved': 'bool',
|
||||||
|
'permission_mode': 'str',
|
||||||
|
'access_grants': 'list[str]',
|
||||||
'unique_name': 'str'
|
'unique_name': 'str'
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,10 +56,12 @@ class ShareRequest(object):
|
|||||||
'oauth_email_domains': 'oauthEmailDomains',
|
'oauth_email_domains': 'oauthEmailDomains',
|
||||||
'oauth_authorization_check_interval': 'oauthAuthorizationCheckInterval',
|
'oauth_authorization_check_interval': 'oauthAuthorizationCheckInterval',
|
||||||
'reserved': 'reserved',
|
'reserved': 'reserved',
|
||||||
|
'permission_mode': 'permissionMode',
|
||||||
|
'access_grants': 'accessGrants',
|
||||||
'unique_name': 'uniqueName'
|
'unique_name': 'uniqueName'
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, env_zid=None, share_mode=None, frontend_selection=None, backend_mode=None, backend_proxy_endpoint=None, auth_scheme=None, auth_users=None, oauth_provider=None, oauth_email_domains=None, oauth_authorization_check_interval=None, reserved=None, unique_name=None): # noqa: E501
|
def __init__(self, env_zid=None, share_mode=None, frontend_selection=None, backend_mode=None, backend_proxy_endpoint=None, auth_scheme=None, auth_users=None, oauth_provider=None, oauth_email_domains=None, oauth_authorization_check_interval=None, reserved=None, permission_mode=None, access_grants=None, unique_name=None): # noqa: E501
|
||||||
"""ShareRequest - a model defined in Swagger""" # noqa: E501
|
"""ShareRequest - a model defined in Swagger""" # noqa: E501
|
||||||
self._env_zid = None
|
self._env_zid = None
|
||||||
self._share_mode = None
|
self._share_mode = None
|
||||||
@ -70,6 +74,8 @@ class ShareRequest(object):
|
|||||||
self._oauth_email_domains = None
|
self._oauth_email_domains = None
|
||||||
self._oauth_authorization_check_interval = None
|
self._oauth_authorization_check_interval = None
|
||||||
self._reserved = None
|
self._reserved = None
|
||||||
|
self._permission_mode = None
|
||||||
|
self._access_grants = None
|
||||||
self._unique_name = None
|
self._unique_name = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
if env_zid is not None:
|
if env_zid is not None:
|
||||||
@ -94,6 +100,10 @@ class ShareRequest(object):
|
|||||||
self.oauth_authorization_check_interval = oauth_authorization_check_interval
|
self.oauth_authorization_check_interval = oauth_authorization_check_interval
|
||||||
if reserved is not None:
|
if reserved is not None:
|
||||||
self.reserved = reserved
|
self.reserved = reserved
|
||||||
|
if permission_mode is not None:
|
||||||
|
self.permission_mode = permission_mode
|
||||||
|
if access_grants is not None:
|
||||||
|
self.access_grants = access_grants
|
||||||
if unique_name is not None:
|
if unique_name is not None:
|
||||||
self.unique_name = unique_name
|
self.unique_name = unique_name
|
||||||
|
|
||||||
@ -346,6 +356,54 @@ class ShareRequest(object):
|
|||||||
|
|
||||||
self._reserved = reserved
|
self._reserved = reserved
|
||||||
|
|
||||||
|
@property
|
||||||
|
def permission_mode(self):
|
||||||
|
"""Gets the permission_mode of this ShareRequest. # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
:return: The permission_mode of this ShareRequest. # noqa: E501
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
|
return self._permission_mode
|
||||||
|
|
||||||
|
@permission_mode.setter
|
||||||
|
def permission_mode(self, permission_mode):
|
||||||
|
"""Sets the permission_mode of this ShareRequest.
|
||||||
|
|
||||||
|
|
||||||
|
:param permission_mode: The permission_mode of this ShareRequest. # noqa: E501
|
||||||
|
:type: str
|
||||||
|
"""
|
||||||
|
allowed_values = ["open", "closed"] # noqa: E501
|
||||||
|
if permission_mode not in allowed_values:
|
||||||
|
raise ValueError(
|
||||||
|
"Invalid value for `permission_mode` ({0}), must be one of {1}" # noqa: E501
|
||||||
|
.format(permission_mode, allowed_values)
|
||||||
|
)
|
||||||
|
|
||||||
|
self._permission_mode = permission_mode
|
||||||
|
|
||||||
|
@property
|
||||||
|
def access_grants(self):
|
||||||
|
"""Gets the access_grants of this ShareRequest. # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
:return: The access_grants of this ShareRequest. # noqa: E501
|
||||||
|
:rtype: list[str]
|
||||||
|
"""
|
||||||
|
return self._access_grants
|
||||||
|
|
||||||
|
@access_grants.setter
|
||||||
|
def access_grants(self, access_grants):
|
||||||
|
"""Sets the access_grants of this ShareRequest.
|
||||||
|
|
||||||
|
|
||||||
|
:param access_grants: The access_grants of this ShareRequest. # noqa: E501
|
||||||
|
:type: list[str]
|
||||||
|
"""
|
||||||
|
|
||||||
|
self._access_grants = access_grants
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def unique_name(self):
|
def unique_name(self):
|
||||||
"""Gets the unique_name of this ShareRequest. # noqa: E501
|
"""Gets the unique_name of this ShareRequest. # noqa: E501
|
||||||
|
@ -1057,6 +1057,13 @@ definitions:
|
|||||||
type: string
|
type: string
|
||||||
reserved:
|
reserved:
|
||||||
type: boolean
|
type: boolean
|
||||||
|
permissionMode:
|
||||||
|
type: string
|
||||||
|
enum: ["open", "closed"]
|
||||||
|
accessGrants:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
uniqueName:
|
uniqueName:
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
|
@ -267,6 +267,8 @@
|
|||||||
* @property {string[]} oauthEmailDomains
|
* @property {string[]} oauthEmailDomains
|
||||||
* @property {string} oauthAuthorizationCheckInterval
|
* @property {string} oauthAuthorizationCheckInterval
|
||||||
* @property {boolean} reserved
|
* @property {boolean} reserved
|
||||||
|
* @property {string} permissionMode
|
||||||
|
* @property {string[]} accessGrants
|
||||||
* @property {string} uniqueName
|
* @property {string} uniqueName
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user