Skip to content

Commit

Permalink
invite token -> 'invToken' (#820, #834)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelquigley committed Feb 4, 2025
1 parent 503dd43 commit d2bebc9
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 33 deletions.
4 changes: 2 additions & 2 deletions cmd/zrok/invite.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ func (cmd *inviteCommand) run(_ *cobra.Command, _ []string) {
}
if cmd.tui.done {
email := cmd.tui.emailInputs[0].Value()
token := cmd.tui.tokenInput.Value()
invToken := cmd.tui.tokenInput.Value()

req := account.NewInviteParams()
req.Body.Email = email
req.Body.Token = token
req.Body.InvToken = invToken
_, err = zrok.Account.Invite(req)
if err != nil {
cmd.endpointError(env.ApiEndpoint())
Expand Down
4 changes: 2 additions & 2 deletions controller/invite.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ func (h *inviteHandler) Handle(params account.InviteParams) middleware.Responder
defer func() { _ = tx.Rollback() }()

if h.cfg.Invites != nil && h.cfg.Invites.TokenStrategy == "store" {
inviteToken, err := str.FindInviteTokenByToken(params.Body.Token, tx)
inviteToken, err := str.FindInviteTokenByToken(params.Body.InvToken, tx)
if err != nil {
logrus.Errorf("cannot get invite token '%v' for '%v': %v", params.Body.Token, params.Body.Email, err)
logrus.Errorf("cannot get invite token '%v' for '%v': %v", params.Body.InvToken, params.Body.Email, err)
return account.NewInviteBadRequest().WithPayload("missing invite token")
}
if err := str.DeleteInviteToken(inviteToken.Id, tx); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions rest_client_zrok/account/invite_responses.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/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/account/invite.go

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

6 changes: 3 additions & 3 deletions sdk/nodejs/sdk/src/zrok/api/model/inviteRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { RequestFile } from './models';

export class InviteRequest {
'email'?: string;
'token'?: string;
'invToken'?: string;

static discriminator: string | undefined = undefined;

Expand All @@ -25,8 +25,8 @@ export class InviteRequest {
"type": "string"
},
{
"name": "token",
"baseName": "token",
"name": "invToken",
"baseName": "invToken",
"type": "string"
} ];

Expand Down
2 changes: 1 addition & 1 deletion sdk/python/sdk/zrok/docs/InviteBody.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**email** | **str** | | [optional]
**token** | **str** | | [optional]
**inv_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)

30 changes: 15 additions & 15 deletions sdk/python/sdk/zrok/zrok_api/models/invite_body.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,23 @@ class InviteBody(object):
"""
swagger_types = {
'email': 'str',
'token': 'str'
'inv_token': 'str'
}

attribute_map = {
'email': 'email',
'token': 'token'
'inv_token': 'invToken'
}

def __init__(self, email=None, token=None): # noqa: E501
def __init__(self, email=None, inv_token=None): # noqa: E501
"""InviteBody - a model defined in Swagger""" # noqa: E501
self._email = None
self._token = None
self._inv_token = None
self.discriminator = None
if email is not None:
self.email = email
if token is not None:
self.token = token
if inv_token is not None:
self.inv_token = inv_token

@property
def email(self):
Expand All @@ -69,25 +69,25 @@ def email(self, email):
self._email = email

@property
def token(self):
"""Gets the token of this InviteBody. # noqa: E501
def inv_token(self):
"""Gets the inv_token of this InviteBody. # noqa: E501
:return: The token of this InviteBody. # noqa: E501
:return: The inv_token of this InviteBody. # noqa: E501
:rtype: str
"""
return self._token
return self._inv_token

@token.setter
def token(self, token):
"""Sets the token of this InviteBody.
@inv_token.setter
def inv_token(self, inv_token):
"""Sets the inv_token of this InviteBody.
:param token: The token of this InviteBody. # noqa: E501
:param inv_token: The inv_token of this InviteBody. # noqa: E501
:type: str
"""

self._token = token
self._inv_token = inv_token

def to_dict(self):
"""Returns the model properties as a dict"""
Expand Down
2 changes: 1 addition & 1 deletion specs/zrok.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ paths:
properties:
email:
type: string
token:
invToken:
type: string
responses:
201:
Expand Down
6 changes: 3 additions & 3 deletions ui/src/api/models/InviteRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export interface InviteRequest {
* @type {string}
* @memberof InviteRequest
*/
token?: string;
invToken?: string;
}

/**
Expand All @@ -51,7 +51,7 @@ export function InviteRequestFromJSONTyped(json: any, ignoreDiscriminator: boole
return {

'email': json['email'] == null ? undefined : json['email'],
'token': json['token'] == null ? undefined : json['token'],
'invToken': json['invToken'] == null ? undefined : json['invToken'],
};
}

Expand All @@ -62,7 +62,7 @@ export function InviteRequestToJSON(value?: InviteRequest | null): any {
return {

'email': value['email'],
'token': value['token'],
'invToken': value['invToken'],
};
}

0 comments on commit d2bebc9

Please sign in to comment.