mirror of
https://github.com/openziti/zrok.git
synced 2025-06-24 19:51:32 +02:00
parent
503dd432c9
commit
d2bebc9151
@ -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())
|
||||
|
@ -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 {
|
||||
|
@ -297,8 +297,8 @@ type InviteBody struct {
|
||||
// email
|
||||
Email string `json:"email,omitempty"`
|
||||
|
||||
// token
|
||||
Token string `json:"token,omitempty"`
|
||||
// inv token
|
||||
InvToken string `json:"invToken,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this invite body
|
||||
|
@ -732,7 +732,7 @@ func init() {
|
||||
"email": {
|
||||
"type": "string"
|
||||
},
|
||||
"token": {
|
||||
"invToken": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
@ -2909,7 +2909,7 @@ func init() {
|
||||
"email": {
|
||||
"type": "string"
|
||||
},
|
||||
"token": {
|
||||
"invToken": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
|
@ -66,8 +66,8 @@ type InviteBody struct {
|
||||
// email
|
||||
Email string `json:"email,omitempty"`
|
||||
|
||||
// token
|
||||
Token string `json:"token,omitempty"`
|
||||
// inv token
|
||||
InvToken string `json:"invToken,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this invite body
|
||||
|
@ -14,7 +14,7 @@ import { RequestFile } from './models';
|
||||
|
||||
export class InviteRequest {
|
||||
'email'?: string;
|
||||
'token'?: string;
|
||||
'invToken'?: string;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
@ -25,8 +25,8 @@ export class InviteRequest {
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "token",
|
||||
"baseName": "token",
|
||||
"name": "invToken",
|
||||
"baseName": "invToken",
|
||||
"type": "string"
|
||||
} ];
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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):
|
||||
@ -69,25 +69,25 @@ class InviteBody(object):
|
||||
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"""
|
||||
|
@ -59,7 +59,7 @@ paths:
|
||||
properties:
|
||||
email:
|
||||
type: string
|
||||
token:
|
||||
invToken:
|
||||
type: string
|
||||
responses:
|
||||
201:
|
||||
|
@ -30,7 +30,7 @@ export interface InviteRequest {
|
||||
* @type {string}
|
||||
* @memberof InviteRequest
|
||||
*/
|
||||
token?: string;
|
||||
invToken?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -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'],
|
||||
};
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ export function InviteRequestToJSON(value?: InviteRequest | null): any {
|
||||
return {
|
||||
|
||||
'email': value['email'],
|
||||
'token': value['token'],
|
||||
'invToken': value['invToken'],
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user