Skip to content

Commit

Permalink
frontend token (#820, #834)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelquigley committed Feb 4, 2025
1 parent fa8200a commit 09fdb92
Show file tree
Hide file tree
Showing 38 changed files with 416 additions and 164 deletions.
2 changes: 1 addition & 1 deletion cmd/zrok/adminCreateFrontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@ func (cmd *adminCreateFrontendCommand) run(_ *cobra.Command, args []string) {
}
}

logrus.Infof("created global public frontend '%v'", resp.Payload.Token)
logrus.Infof("created global public frontend '%v'", resp.Payload.FrontendToken)
}
2 changes: 1 addition & 1 deletion cmd/zrok/adminListFrontends.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (cmd *adminListFrontendsCommand) run(_ *cobra.Command, _ []string) {
t.AppendHeader(table.Row{"Token", "zId", "Public Name", "Url Template", "Created At", "Updated At"})
for _, pfe := range resp.Payload {
t.AppendRow(table.Row{
pfe.Token,
pfe.FrontendToken,
pfe.ZID,
pfe.PublicName,
pfe.URLTemplate,
Expand Down
2 changes: 1 addition & 1 deletion controller/createFrontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,5 @@ func (h *createFrontendHandler) Handle(params admin.CreateFrontendParams, princi

logrus.Infof("created global frontend '%v' with public name '%v'", fe.Token, *fe.PublicName)

return admin.NewCreateFrontendCreated().WithPayload(&admin.CreateFrontendCreatedBody{Token: feToken})
return admin.NewCreateFrontendCreated().WithPayload(&admin.CreateFrontendCreatedBody{FrontendToken: feToken})
}
8 changes: 4 additions & 4 deletions controller/listFrontends.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ func (h *listFrontendsHandler) Handle(params admin.ListFrontendsParams, principa
var frontends []*admin.ListFrontendsOKBodyItems0
for _, sfe := range sfes {
frontend := &admin.ListFrontendsOKBodyItems0{
Token: sfe.Token,
ZID: sfe.ZId,
CreatedAt: sfe.CreatedAt.UnixMilli(),
UpdatedAt: sfe.UpdatedAt.UnixMilli(),
FrontendToken: sfe.Token,
ZID: sfe.ZId,
CreatedAt: sfe.CreatedAt.UnixMilli(),
UpdatedAt: sfe.UpdatedAt.UnixMilli(),
}
if sfe.UrlTemplate != nil {
frontend.URLTemplate = *sfe.UrlTemplate
Expand Down
4 changes: 2 additions & 2 deletions rest_client_zrok/admin/create_frontend_responses.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions rest_client_zrok/admin/list_frontends_responses.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions rest_server_zrok/embedded_spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions rest_server_zrok/operations/admin/create_frontend.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions rest_server_zrok/operations/admin/list_frontends.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdk/nodejs/sdk/src/zrok/api/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ model/addOrganizationMemberRequest.ts
model/authUser.ts
model/changePasswordRequest.ts
model/configuration.ts
model/createFrontend201Response.ts
model/createFrontendRequest.ts
model/createIdentity201Response.ts
model/createIdentityRequest.ts
model/createOrganizationRequest.ts
model/deleteFrontendRequest.ts
model/disableRequest.ts
model/enableRequest.ts
model/environment.ts
Expand Down
12 changes: 6 additions & 6 deletions sdk/nodejs/sdk/src/zrok/api/api/adminApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import http from 'http';

/* tslint:disable:no-unused-locals */
import { AddOrganizationMemberRequest } from '../model/addOrganizationMemberRequest';
import { CreateFrontend201Response } from '../model/createFrontend201Response';
import { CreateFrontendRequest } from '../model/createFrontendRequest';
import { CreateIdentity201Response } from '../model/createIdentity201Response';
import { CreateIdentityRequest } from '../model/createIdentityRequest';
import { CreateOrganizationRequest } from '../model/createOrganizationRequest';
import { DeleteFrontendRequest } from '../model/deleteFrontendRequest';
import { InviteTokenGenerateRequest } from '../model/inviteTokenGenerateRequest';
import { ListFrontends200ResponseInner } from '../model/listFrontends200ResponseInner';
import { ListOrganizationMembers200Response } from '../model/listOrganizationMembers200Response';
Expand Down Expand Up @@ -232,7 +232,7 @@ export class AdminApi {
*
* @param body
*/
public async createFrontend (body?: CreateFrontendRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: VerifyRequest; }> {
public async createFrontend (body?: CreateFrontendRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateFrontend201Response; }> {
const localVarPath = this.basePath + '/frontend';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
Expand Down Expand Up @@ -278,13 +278,13 @@ export class AdminApi {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: VerifyRequest; }>((resolve, reject) => {
return new Promise<{ response: http.IncomingMessage; body: CreateFrontend201Response; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "VerifyRequest");
body = ObjectSerializer.deserialize(body, "CreateFrontend201Response");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
Expand Down Expand Up @@ -430,7 +430,7 @@ export class AdminApi {
*
* @param body
*/
public async deleteFrontend (body?: DeleteFrontendRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
public async deleteFrontend (body?: CreateFrontend201Response, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/frontend';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
Expand All @@ -447,7 +447,7 @@ export class AdminApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "DeleteFrontendRequest")
body: ObjectSerializer.serialize(body, "CreateFrontend201Response")
};

let authenticationPromise = Promise.resolve();
Expand Down
31 changes: 31 additions & 0 deletions sdk/nodejs/sdk/src/zrok/api/model/createFrontend201Response.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

import { RequestFile } from './models';

export class CreateFrontend201Response {
'frontendToken'?: string;

static discriminator: string | undefined = undefined;

static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "frontendToken",
"baseName": "frontendToken",
"type": "string"
} ];

static getAttributeTypeMap() {
return CreateFrontend201Response.attributeTypeMap;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import { RequestFile } from './models';

export class ListFrontends200ResponseInner {
'token'?: string;
'frontendToken'?: string;
'zId'?: string;
'urlTemplate'?: string;
'publicName'?: string;
Expand All @@ -24,8 +24,8 @@ export class ListFrontends200ResponseInner {

static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "token",
"baseName": "token",
"name": "frontendToken",
"baseName": "frontendToken",
"type": "string"
},
{
Expand Down
6 changes: 3 additions & 3 deletions sdk/nodejs/sdk/src/zrok/api/model/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ export * from './addOrganizationMemberRequest';
export * from './authUser';
export * from './changePasswordRequest';
export * from './configuration';
export * from './createFrontend201Response';
export * from './createFrontendRequest';
export * from './createIdentity201Response';
export * from './createIdentityRequest';
export * from './createOrganizationRequest';
export * from './deleteFrontendRequest';
export * from './disableRequest';
export * from './enableRequest';
export * from './environment';
Expand Down Expand Up @@ -67,11 +67,11 @@ import { AddOrganizationMemberRequest } from './addOrganizationMemberRequest';
import { AuthUser } from './authUser';
import { ChangePasswordRequest } from './changePasswordRequest';
import { Configuration } from './configuration';
import { CreateFrontend201Response } from './createFrontend201Response';
import { CreateFrontendRequest } from './createFrontendRequest';
import { CreateIdentity201Response } from './createIdentity201Response';
import { CreateIdentityRequest } from './createIdentityRequest';
import { CreateOrganizationRequest } from './createOrganizationRequest';
import { DeleteFrontendRequest } from './deleteFrontendRequest';
import { DisableRequest } from './disableRequest';
import { EnableRequest } from './enableRequest';
import { Environment } from './environment';
Expand Down Expand Up @@ -136,11 +136,11 @@ let typeMap: {[index: string]: any} = {
"AuthUser": AuthUser,
"ChangePasswordRequest": ChangePasswordRequest,
"Configuration": Configuration,
"CreateFrontend201Response": CreateFrontend201Response,
"CreateFrontendRequest": CreateFrontendRequest,
"CreateIdentity201Response": CreateIdentity201Response,
"CreateIdentityRequest": CreateIdentityRequest,
"CreateOrganizationRequest": CreateOrganizationRequest,
"DeleteFrontendRequest": DeleteFrontendRequest,
"DisableRequest": DisableRequest,
"EnableRequest": EnableRequest,
"Environment": Environment,
Expand Down
1 change: 1 addition & 0 deletions sdk/python/sdk/zrok/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ Class | Method | HTTP request | Description
- [InlineResponse2006](docs/InlineResponse2006.md)
- [InlineResponse201](docs/InlineResponse201.md)
- [InlineResponse2011](docs/InlineResponse2011.md)
- [InlineResponse2012](docs/InlineResponse2012.md)
- [InviteBody](docs/InviteBody.md)
- [LoginBody](docs/LoginBody.md)
- [Metrics](docs/Metrics.md)
Expand Down
8 changes: 4 additions & 4 deletions sdk/python/sdk/zrok/docs/AdminApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **create_frontend**
> VerifyBody create_frontend(body=body)
> InlineResponse201 create_frontend(body=body)


Expand Down Expand Up @@ -158,7 +158,7 @@ Name | Type | Description | Notes

### Return type

[**VerifyBody**](VerifyBody.md)
[**InlineResponse201**](InlineResponse201.md)

### Authorization

Expand All @@ -172,7 +172,7 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **create_identity**
> InlineResponse201 create_identity(body=body)
> InlineResponse2011 create_identity(body=body)


Expand Down Expand Up @@ -209,7 +209,7 @@ Name | Type | Description | Notes

### Return type

[**InlineResponse201**](InlineResponse201.md)
[**InlineResponse2011**](InlineResponse2011.md)

### Authorization

Expand Down
4 changes: 2 additions & 2 deletions sdk/python/sdk/zrok/docs/EnvironmentApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void (empty response body)
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **enable**
> InlineResponse201 enable(body=body)
> InlineResponse2011 enable(body=body)


Expand Down Expand Up @@ -95,7 +95,7 @@ Name | Type | Description | Notes

### Return type

[**InlineResponse201**](InlineResponse201.md)
[**InlineResponse2011**](InlineResponse2011.md)

### Authorization

Expand Down
2 changes: 1 addition & 1 deletion sdk/python/sdk/zrok/docs/InlineResponse2002.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**token** | **str** | | [optional]
**frontend_token** | **str** | | [optional]
**z_id** | **str** | | [optional]
**url_template** | **str** | | [optional]
**public_name** | **str** | | [optional]
Expand Down
3 changes: 1 addition & 2 deletions sdk/python/sdk/zrok/docs/InlineResponse201.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**identity** | **str** | | [optional]
**cfg** | **str** | | [optional]
**frontend_token** | **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)

4 changes: 2 additions & 2 deletions sdk/python/sdk/zrok/docs/InlineResponse2011.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**frontend_token** | **str** | | [optional]
**backend_mode** | **str** | | [optional]
**identity** | **str** | | [optional]
**cfg** | **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)

10 changes: 10 additions & 0 deletions sdk/python/sdk/zrok/docs/InlineResponse2012.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# InlineResponse2012

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**frontend_token** | **str** | | [optional]
**backend_mode** | **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)

Loading

0 comments on commit 09fdb92

Please sign in to comment.