diff --git a/controller/store/frontend.go b/controller/store/frontend.go index e24fa685..d0cbf678 100644 --- a/controller/store/frontend.go +++ b/controller/store/frontend.go @@ -16,15 +16,16 @@ type Frontend struct { Reserved bool PermissionMode PermissionMode Description *string + BindAddress *string } func (str *Store) CreateFrontend(envId int, f *Frontend, tx *sqlx.Tx) (int, error) { - stmt, err := tx.Prepare("insert into frontends (environment_id, private_share_id, token, z_id, public_name, url_template, reserved, permission_mode, description) values ($1, $2, $3, $4, $5, $6, $7, $8, $9) returning id") + stmt, err := tx.Prepare("insert into frontends (environment_id, private_share_id, token, z_id, public_name, url_template, reserved, permission_mode, description, bind_address) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) returning id") if err != nil { return 0, errors.Wrap(err, "error preparing frontends insert statement") } var id int - if err := stmt.QueryRow(envId, f.PrivateShareId, f.Token, f.ZId, f.PublicName, f.UrlTemplate, f.Reserved, f.PermissionMode, f.Description).Scan(&id); err != nil { + if err := stmt.QueryRow(envId, f.PrivateShareId, f.Token, f.ZId, f.PublicName, f.UrlTemplate, f.Reserved, f.PermissionMode, f.Description, f.BindAddress).Scan(&id); err != nil { return 0, errors.Wrap(err, "error executing frontends insert statement") } return id, nil @@ -123,12 +124,12 @@ func (str *Store) FindFrontendsForPrivateShare(shrId int, tx *sqlx.Tx) ([]*Front } func (str *Store) UpdateFrontend(fe *Frontend, tx *sqlx.Tx) error { - sql := "update frontends set environment_id = $1, private_share_id = $2, token = $3, z_id = $4, public_name = $5, url_template = $6, reserved = $7, permission_mode = $8, description = $9, updated_at = current_timestamp where id = $10" + sql := "update frontends set environment_id = $1, private_share_id = $2, token = $3, z_id = $4, public_name = $5, url_template = $6, reserved = $7, permission_mode = $8, description = $9, bind_address = $10, updated_at = current_timestamp where id = $11" stmt, err := tx.Prepare(sql) if err != nil { return errors.Wrap(err, "error preparing frontends update statement") } - _, err = stmt.Exec(fe.EnvironmentId, fe.PrivateShareId, fe.Token, fe.ZId, fe.PublicName, fe.UrlTemplate, fe.Reserved, fe.PermissionMode, fe.Description, fe.Id) + _, err = stmt.Exec(fe.EnvironmentId, fe.PrivateShareId, fe.Token, fe.ZId, fe.PublicName, fe.UrlTemplate, fe.Reserved, fe.PermissionMode, fe.Description, fe.BindAddress, fe.Id) if err != nil { return errors.Wrap(err, "error executing frontends update statement") } diff --git a/controller/store/sql/postgresql/032_v1_0_0_frontend_bindAddress.sql b/controller/store/sql/postgresql/032_v1_0_0_frontend_bindAddress.sql new file mode 100644 index 00000000..7bb3d343 --- /dev/null +++ b/controller/store/sql/postgresql/032_v1_0_0_frontend_bindAddress.sql @@ -0,0 +1,3 @@ +-- +migrate Up + +alter table frontends add column bind_address varchar(128); \ No newline at end of file diff --git a/controller/store/sql/sqlite3/032_v1_0_0_frontend_bindAddress.sql b/controller/store/sql/sqlite3/032_v1_0_0_frontend_bindAddress.sql new file mode 100644 index 00000000..7bb3d343 --- /dev/null +++ b/controller/store/sql/sqlite3/032_v1_0_0_frontend_bindAddress.sql @@ -0,0 +1,3 @@ +-- +migrate Up + +alter table frontends add column bind_address varchar(128); \ No newline at end of file diff --git a/rest_client_zrok/share/access_responses.go b/rest_client_zrok/share/access_responses.go index 91d6c8dc..6e476af5 100644 --- a/rest_client_zrok/share/access_responses.go +++ b/rest_client_zrok/share/access_responses.go @@ -294,6 +294,9 @@ swagger:model AccessBody */ type AccessBody struct { + // bind address + BindAddress string `json:"bindAddress,omitempty"` + // description Description string `json:"description,omitempty"` diff --git a/rest_client_zrok/share/update_access_responses.go b/rest_client_zrok/share/update_access_responses.go index 532b55a0..08ccbb97 100644 --- a/rest_client_zrok/share/update_access_responses.go +++ b/rest_client_zrok/share/update_access_responses.go @@ -281,6 +281,9 @@ swagger:model UpdateAccessBody */ type UpdateAccessBody struct { + // bind address + BindAddress string `json:"bindAddress,omitempty"` + // description Description string `json:"description,omitempty"` diff --git a/rest_model_zrok/frontend.go b/rest_model_zrok/frontend.go index 341a0b97..f5e03365 100644 --- a/rest_model_zrok/frontend.go +++ b/rest_model_zrok/frontend.go @@ -17,6 +17,12 @@ import ( // swagger:model frontend type Frontend struct { + // backend mode + BackendMode string `json:"backendMode,omitempty"` + + // bind address + BindAddress string `json:"bindAddress,omitempty"` + // created at CreatedAt int64 `json:"createdAt,omitempty"` diff --git a/rest_server_zrok/embedded_spec.go b/rest_server_zrok/embedded_spec.go index cc34a789..6b61e327 100644 --- a/rest_server_zrok/embedded_spec.go +++ b/rest_server_zrok/embedded_spec.go @@ -52,6 +52,9 @@ func init() { "in": "body", "schema": { "properties": { + "bindAddress": { + "type": "string" + }, "description": { "type": "string" }, @@ -106,6 +109,9 @@ func init() { "in": "body", "schema": { "properties": { + "bindAddress": { + "type": "string" + }, "description": { "type": "string" }, @@ -1993,6 +1999,12 @@ func init() { "frontend": { "type": "object", "properties": { + "backendMode": { + "type": "string" + }, + "bindAddress": { + "type": "string" + }, "createdAt": { "type": "integer" }, @@ -2296,6 +2308,9 @@ func init() { "in": "body", "schema": { "properties": { + "bindAddress": { + "type": "string" + }, "description": { "type": "string" }, @@ -2350,6 +2365,9 @@ func init() { "in": "body", "schema": { "properties": { + "bindAddress": { + "type": "string" + }, "description": { "type": "string" }, @@ -4242,6 +4260,12 @@ func init() { "frontend": { "type": "object", "properties": { + "backendMode": { + "type": "string" + }, + "bindAddress": { + "type": "string" + }, "createdAt": { "type": "integer" }, diff --git a/rest_server_zrok/operations/share/access.go b/rest_server_zrok/operations/share/access.go index 68e7f008..83b71399 100644 --- a/rest_server_zrok/operations/share/access.go +++ b/rest_server_zrok/operations/share/access.go @@ -78,6 +78,9 @@ func (o *Access) ServeHTTP(rw http.ResponseWriter, r *http.Request) { // swagger:model AccessBody type AccessBody struct { + // bind address + BindAddress string `json:"bindAddress,omitempty"` + // description Description string `json:"description,omitempty"` diff --git a/rest_server_zrok/operations/share/update_access.go b/rest_server_zrok/operations/share/update_access.go index 511cff15..7c28bbee 100644 --- a/rest_server_zrok/operations/share/update_access.go +++ b/rest_server_zrok/operations/share/update_access.go @@ -78,6 +78,9 @@ func (o *UpdateAccess) ServeHTTP(rw http.ResponseWriter, r *http.Request) { // swagger:model UpdateAccessBody type UpdateAccessBody struct { + // bind address + BindAddress string `json:"bindAddress,omitempty"` + // description Description string `json:"description,omitempty"` diff --git a/sdk/nodejs/sdk/src/zrok/api/model/accessRequest.ts b/sdk/nodejs/sdk/src/zrok/api/model/accessRequest.ts index b02a5466..220e4f22 100644 --- a/sdk/nodejs/sdk/src/zrok/api/model/accessRequest.ts +++ b/sdk/nodejs/sdk/src/zrok/api/model/accessRequest.ts @@ -15,6 +15,7 @@ import { RequestFile } from './models'; export class AccessRequest { 'envZId'?: string; 'shareToken'?: string; + 'bindAddress'?: string; 'description'?: string; static discriminator: string | undefined = undefined; @@ -30,6 +31,11 @@ export class AccessRequest { "baseName": "shareToken", "type": "string" }, + { + "name": "bindAddress", + "baseName": "bindAddress", + "type": "string" + }, { "name": "description", "baseName": "description", diff --git a/sdk/nodejs/sdk/src/zrok/api/model/frontend.ts b/sdk/nodejs/sdk/src/zrok/api/model/frontend.ts index 6d98209c..0077f8f6 100644 --- a/sdk/nodejs/sdk/src/zrok/api/model/frontend.ts +++ b/sdk/nodejs/sdk/src/zrok/api/model/frontend.ts @@ -16,6 +16,8 @@ export class Frontend { 'id'?: number; 'frontendToken'?: string; 'shareToken'?: string; + 'backendMode'?: string; + 'bindAddress'?: string; 'description'?: string; 'zId'?: string; 'createdAt'?: number; @@ -39,6 +41,16 @@ export class Frontend { "baseName": "shareToken", "type": "string" }, + { + "name": "backendMode", + "baseName": "backendMode", + "type": "string" + }, + { + "name": "bindAddress", + "baseName": "bindAddress", + "type": "string" + }, { "name": "description", "baseName": "description", diff --git a/sdk/nodejs/sdk/src/zrok/api/model/updateAccessRequest.ts b/sdk/nodejs/sdk/src/zrok/api/model/updateAccessRequest.ts index bca84120..f0167d45 100644 --- a/sdk/nodejs/sdk/src/zrok/api/model/updateAccessRequest.ts +++ b/sdk/nodejs/sdk/src/zrok/api/model/updateAccessRequest.ts @@ -14,6 +14,7 @@ import { RequestFile } from './models'; export class UpdateAccessRequest { 'frontendToken'?: string; + 'bindAddress'?: string; 'description'?: string; static discriminator: string | undefined = undefined; @@ -24,6 +25,11 @@ export class UpdateAccessRequest { "baseName": "frontendToken", "type": "string" }, + { + "name": "bindAddress", + "baseName": "bindAddress", + "type": "string" + }, { "name": "description", "baseName": "description", diff --git a/sdk/python/sdk/zrok/docs/AccessBody.md b/sdk/python/sdk/zrok/docs/AccessBody.md index 8b42a3ff..86e3636b 100644 --- a/sdk/python/sdk/zrok/docs/AccessBody.md +++ b/sdk/python/sdk/zrok/docs/AccessBody.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **env_zid** | **str** | | [optional] **share_token** | **str** | | [optional] +**bind_address** | **str** | | [optional] **description** | **str** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdk/python/sdk/zrok/docs/AccessBody1.md b/sdk/python/sdk/zrok/docs/AccessBody1.md index afb601c9..68968950 100644 --- a/sdk/python/sdk/zrok/docs/AccessBody1.md +++ b/sdk/python/sdk/zrok/docs/AccessBody1.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **frontend_token** | **str** | | [optional] +**bind_address** | **str** | | [optional] **description** | **str** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdk/python/sdk/zrok/docs/Frontend.md b/sdk/python/sdk/zrok/docs/Frontend.md index 4d0f1e5c..428eb19d 100644 --- a/sdk/python/sdk/zrok/docs/Frontend.md +++ b/sdk/python/sdk/zrok/docs/Frontend.md @@ -6,6 +6,8 @@ Name | Type | Description | Notes **id** | **int** | | [optional] **frontend_token** | **str** | | [optional] **share_token** | **str** | | [optional] +**backend_mode** | **str** | | [optional] +**bind_address** | **str** | | [optional] **description** | **str** | | [optional] **z_id** | **str** | | [optional] **created_at** | **int** | | [optional] diff --git a/sdk/python/sdk/zrok/zrok_api/models/access_body.py b/sdk/python/sdk/zrok/zrok_api/models/access_body.py index ba3b148f..ca0ded7f 100644 --- a/sdk/python/sdk/zrok/zrok_api/models/access_body.py +++ b/sdk/python/sdk/zrok/zrok_api/models/access_body.py @@ -30,25 +30,30 @@ class AccessBody(object): swagger_types = { 'env_zid': 'str', 'share_token': 'str', + 'bind_address': 'str', 'description': 'str' } attribute_map = { 'env_zid': 'envZId', 'share_token': 'shareToken', + 'bind_address': 'bindAddress', 'description': 'description' } - def __init__(self, env_zid=None, share_token=None, description=None): # noqa: E501 + def __init__(self, env_zid=None, share_token=None, bind_address=None, description=None): # noqa: E501 """AccessBody - a model defined in Swagger""" # noqa: E501 self._env_zid = None self._share_token = None + self._bind_address = None self._description = None self.discriminator = None if env_zid is not None: self.env_zid = env_zid if share_token is not None: self.share_token = share_token + if bind_address is not None: + self.bind_address = bind_address if description is not None: self.description = description @@ -94,6 +99,27 @@ class AccessBody(object): self._share_token = share_token + @property + def bind_address(self): + """Gets the bind_address of this AccessBody. # noqa: E501 + + + :return: The bind_address of this AccessBody. # noqa: E501 + :rtype: str + """ + return self._bind_address + + @bind_address.setter + def bind_address(self, bind_address): + """Sets the bind_address of this AccessBody. + + + :param bind_address: The bind_address of this AccessBody. # noqa: E501 + :type: str + """ + + self._bind_address = bind_address + @property def description(self): """Gets the description of this AccessBody. # noqa: E501 diff --git a/sdk/python/sdk/zrok/zrok_api/models/access_body1.py b/sdk/python/sdk/zrok/zrok_api/models/access_body1.py index 1bc7e2b5..97855ec4 100644 --- a/sdk/python/sdk/zrok/zrok_api/models/access_body1.py +++ b/sdk/python/sdk/zrok/zrok_api/models/access_body1.py @@ -29,21 +29,26 @@ class AccessBody1(object): """ swagger_types = { 'frontend_token': 'str', + 'bind_address': 'str', 'description': 'str' } attribute_map = { 'frontend_token': 'frontendToken', + 'bind_address': 'bindAddress', 'description': 'description' } - def __init__(self, frontend_token=None, description=None): # noqa: E501 + def __init__(self, frontend_token=None, bind_address=None, description=None): # noqa: E501 """AccessBody1 - a model defined in Swagger""" # noqa: E501 self._frontend_token = None + self._bind_address = None self._description = None self.discriminator = None if frontend_token is not None: self.frontend_token = frontend_token + if bind_address is not None: + self.bind_address = bind_address if description is not None: self.description = description @@ -68,6 +73,27 @@ class AccessBody1(object): self._frontend_token = frontend_token + @property + def bind_address(self): + """Gets the bind_address of this AccessBody1. # noqa: E501 + + + :return: The bind_address of this AccessBody1. # noqa: E501 + :rtype: str + """ + return self._bind_address + + @bind_address.setter + def bind_address(self, bind_address): + """Sets the bind_address of this AccessBody1. + + + :param bind_address: The bind_address of this AccessBody1. # noqa: E501 + :type: str + """ + + self._bind_address = bind_address + @property def description(self): """Gets the description of this AccessBody1. # noqa: E501 diff --git a/sdk/python/sdk/zrok/zrok_api/models/frontend.py b/sdk/python/sdk/zrok/zrok_api/models/frontend.py index 95827ca9..46cf93eb 100644 --- a/sdk/python/sdk/zrok/zrok_api/models/frontend.py +++ b/sdk/python/sdk/zrok/zrok_api/models/frontend.py @@ -31,6 +31,8 @@ class Frontend(object): 'id': 'int', 'frontend_token': 'str', 'share_token': 'str', + 'backend_mode': 'str', + 'bind_address': 'str', 'description': 'str', 'z_id': 'str', 'created_at': 'int', @@ -41,17 +43,21 @@ class Frontend(object): 'id': 'id', 'frontend_token': 'frontendToken', 'share_token': 'shareToken', + 'backend_mode': 'backendMode', + 'bind_address': 'bindAddress', 'description': 'description', 'z_id': 'zId', 'created_at': 'createdAt', 'updated_at': 'updatedAt' } - def __init__(self, id=None, frontend_token=None, share_token=None, description=None, z_id=None, created_at=None, updated_at=None): # noqa: E501 + def __init__(self, id=None, frontend_token=None, share_token=None, backend_mode=None, bind_address=None, description=None, z_id=None, created_at=None, updated_at=None): # noqa: E501 """Frontend - a model defined in Swagger""" # noqa: E501 self._id = None self._frontend_token = None self._share_token = None + self._backend_mode = None + self._bind_address = None self._description = None self._z_id = None self._created_at = None @@ -63,6 +69,10 @@ class Frontend(object): self.frontend_token = frontend_token if share_token is not None: self.share_token = share_token + if backend_mode is not None: + self.backend_mode = backend_mode + if bind_address is not None: + self.bind_address = bind_address if description is not None: self.description = description if z_id is not None: @@ -135,6 +145,48 @@ class Frontend(object): self._share_token = share_token + @property + def backend_mode(self): + """Gets the backend_mode of this Frontend. # noqa: E501 + + + :return: The backend_mode of this Frontend. # noqa: E501 + :rtype: str + """ + return self._backend_mode + + @backend_mode.setter + def backend_mode(self, backend_mode): + """Sets the backend_mode of this Frontend. + + + :param backend_mode: The backend_mode of this Frontend. # noqa: E501 + :type: str + """ + + self._backend_mode = backend_mode + + @property + def bind_address(self): + """Gets the bind_address of this Frontend. # noqa: E501 + + + :return: The bind_address of this Frontend. # noqa: E501 + :rtype: str + """ + return self._bind_address + + @bind_address.setter + def bind_address(self, bind_address): + """Sets the bind_address of this Frontend. + + + :param bind_address: The bind_address of this Frontend. # noqa: E501 + :type: str + """ + + self._bind_address = bind_address + @property def description(self): """Gets the description of this Frontend. # noqa: E501 diff --git a/specs/zrok.yml b/specs/zrok.yml index 0ff8e009..b245d64e 100644 --- a/specs/zrok.yml +++ b/specs/zrok.yml @@ -1011,6 +1011,8 @@ paths: type: string shareToken: type: string + bindAddress: + type: string description: type: string responses: @@ -1041,6 +1043,8 @@ paths: properties: frontendToken: type: string + bindAddress: + type: string description: type: string responses: @@ -1245,6 +1249,10 @@ definitions: type: string shareToken: type: string + backendMode: + type: string + bindAddress: + type: string description: type: string zId: diff --git a/ui/src/api/models/AccessRequest.ts b/ui/src/api/models/AccessRequest.ts index 22e11a1f..0ac0ca11 100644 --- a/ui/src/api/models/AccessRequest.ts +++ b/ui/src/api/models/AccessRequest.ts @@ -31,6 +31,12 @@ export interface AccessRequest { * @memberof AccessRequest */ shareToken?: string; + /** + * + * @type {string} + * @memberof AccessRequest + */ + bindAddress?: string; /** * * @type {string} @@ -58,6 +64,7 @@ export function AccessRequestFromJSONTyped(json: any, ignoreDiscriminator: boole 'envZId': json['envZId'] == null ? undefined : json['envZId'], 'shareToken': json['shareToken'] == null ? undefined : json['shareToken'], + 'bindAddress': json['bindAddress'] == null ? undefined : json['bindAddress'], 'description': json['description'] == null ? undefined : json['description'], }; } @@ -70,6 +77,7 @@ export function AccessRequestToJSON(value?: AccessRequest | null): any { 'envZId': value['envZId'], 'shareToken': value['shareToken'], + 'bindAddress': value['bindAddress'], 'description': value['description'], }; } diff --git a/ui/src/api/models/Frontend.ts b/ui/src/api/models/Frontend.ts index 8a0cea43..9c2885c4 100644 --- a/ui/src/api/models/Frontend.ts +++ b/ui/src/api/models/Frontend.ts @@ -37,6 +37,18 @@ export interface Frontend { * @memberof Frontend */ shareToken?: string; + /** + * + * @type {string} + * @memberof Frontend + */ + backendMode?: string; + /** + * + * @type {string} + * @memberof Frontend + */ + bindAddress?: string; /** * * @type {string} @@ -83,6 +95,8 @@ export function FrontendFromJSONTyped(json: any, ignoreDiscriminator: boolean): 'id': json['id'] == null ? undefined : json['id'], 'frontendToken': json['frontendToken'] == null ? undefined : json['frontendToken'], 'shareToken': json['shareToken'] == null ? undefined : json['shareToken'], + 'backendMode': json['backendMode'] == null ? undefined : json['backendMode'], + 'bindAddress': json['bindAddress'] == null ? undefined : json['bindAddress'], 'description': json['description'] == null ? undefined : json['description'], 'zId': json['zId'] == null ? undefined : json['zId'], 'createdAt': json['createdAt'] == null ? undefined : json['createdAt'], @@ -99,6 +113,8 @@ export function FrontendToJSON(value?: Frontend | null): any { 'id': value['id'], 'frontendToken': value['frontendToken'], 'shareToken': value['shareToken'], + 'backendMode': value['backendMode'], + 'bindAddress': value['bindAddress'], 'description': value['description'], 'zId': value['zId'], 'createdAt': value['createdAt'], diff --git a/ui/src/api/models/UpdateAccessRequest.ts b/ui/src/api/models/UpdateAccessRequest.ts index a23195ca..7292c1d0 100644 --- a/ui/src/api/models/UpdateAccessRequest.ts +++ b/ui/src/api/models/UpdateAccessRequest.ts @@ -25,6 +25,12 @@ export interface UpdateAccessRequest { * @memberof UpdateAccessRequest */ frontendToken?: string; + /** + * + * @type {string} + * @memberof UpdateAccessRequest + */ + bindAddress?: string; /** * * @type {string} @@ -51,6 +57,7 @@ export function UpdateAccessRequestFromJSONTyped(json: any, ignoreDiscriminator: return { 'frontendToken': json['frontendToken'] == null ? undefined : json['frontendToken'], + 'bindAddress': json['bindAddress'] == null ? undefined : json['bindAddress'], 'description': json['description'] == null ? undefined : json['description'], }; } @@ -62,6 +69,7 @@ export function UpdateAccessRequestToJSON(value?: UpdateAccessRequest | null): a return { 'frontendToken': value['frontendToken'], + 'bindAddress': value['bindAddress'], 'description': value['description'], }; }