account token (#820, #834)

This commit is contained in:
Michael Quigley 2025-02-04 14:16:16 -05:00
parent 4e81bbf80b
commit fa8200a603
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
10 changed files with 24 additions and 20 deletions

View File

@ -46,5 +46,5 @@ func (cmd *adminCreateAccount) run(_ *cobra.Command, args []string) {
panic(err)
}
fmt.Println(resp.GetPayload().Token)
fmt.Println(resp.GetPayload().AccountToken)
}

View File

@ -55,5 +55,5 @@ func (h *createAccountHandler) Handle(params admin.CreateAccountParams, principa
logrus.Infof("administratively created account '%v'", params.Body.Email)
return admin.NewCreateAccountCreated().WithPayload(&admin.CreateAccountCreatedBody{Token: token})
return admin.NewCreateAccountCreated().WithPayload(&admin.CreateAccountCreatedBody{AccountToken: token})
}

View File

@ -273,8 +273,8 @@ swagger:model CreateAccountCreatedBody
*/
type CreateAccountCreatedBody struct {
// token
Token string `json:"token,omitempty"`
// account token
AccountToken string `json:"accountToken,omitempty"`
}
// Validate validates this create account created body

View File

@ -120,7 +120,7 @@ func init() {
"description": "created",
"schema": {
"properties": {
"token": {
"accountToken": {
"type": "string"
}
}
@ -2317,7 +2317,7 @@ func init() {
"description": "created",
"schema": {
"properties": {
"token": {
"accountToken": {
"type": "string"
}
}

View File

@ -118,8 +118,8 @@ func (o *CreateAccountBody) UnmarshalBinary(b []byte) error {
// swagger:model CreateAccountCreatedBody
type CreateAccountCreatedBody struct {
// token
Token string `json:"token,omitempty"`
// account token
AccountToken string `json:"accountToken,omitempty"`
}
// Validate validates this create account created body

View File

@ -26,6 +26,7 @@ import { ListFrontends200ResponseInner } from '../model/listFrontends200Response
import { ListOrganizationMembers200Response } from '../model/listOrganizationMembers200Response';
import { ListOrganizations200Response } from '../model/listOrganizations200Response';
import { LoginRequest } from '../model/loginRequest';
import { RegenerateAccountToken200Response } from '../model/regenerateAccountToken200Response';
import { RemoveOrganizationMemberRequest } from '../model/removeOrganizationMemberRequest';
import { UpdateFrontendRequest } from '../model/updateFrontendRequest';
import { Verify200Response } from '../model/verify200Response';
@ -165,7 +166,7 @@ export class AdminApi {
*
* @param body
*/
public async createAccount (body?: LoginRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: VerifyRequest; }> {
public async createAccount (body?: LoginRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: RegenerateAccountToken200Response; }> {
const localVarPath = this.basePath + '/account';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
@ -211,13 +212,13 @@ export class AdminApi {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: VerifyRequest; }>((resolve, reject) => {
return new Promise<{ response: http.IncomingMessage; body: RegenerateAccountToken200Response; }>((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, "RegenerateAccountToken200Response");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));

View File

@ -70,7 +70,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)
# **create_account**
> VerifyBody create_account(body=body)
> InlineResponse200 create_account(body=body)
@ -107,7 +107,7 @@ Name | Type | Description | Notes
### Return type
[**VerifyBody**](VerifyBody.md)
[**InlineResponse200**](InlineResponse200.md)
### Authorization

View File

@ -131,7 +131,7 @@ class AdminApi(object):
:param async_req bool
:param AccountBody body:
:return: VerifyBody
:return: InlineResponse200
If the method is called asynchronously,
returns the request thread.
"""
@ -152,7 +152,7 @@ class AdminApi(object):
:param async_req bool
:param AccountBody body:
:return: VerifyBody
:return: InlineResponse200
If the method is called asynchronously,
returns the request thread.
"""
@ -206,7 +206,7 @@ class AdminApi(object):
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='VerifyBody', # noqa: E501
response_type='InlineResponse200', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),

View File

@ -245,7 +245,7 @@ paths:
description: created
schema:
properties:
token:
accountToken:
type: string
401:
description: unauthorized

View File

@ -26,6 +26,7 @@ import type {
ListOrganizationMembers200Response,
ListOrganizations200Response,
LoginRequest,
RegenerateAccountToken200Response,
RemoveOrganizationMemberRequest,
UpdateFrontendRequest,
Verify200Response,
@ -54,6 +55,8 @@ import {
ListOrganizations200ResponseToJSON,
LoginRequestFromJSON,
LoginRequestToJSON,
RegenerateAccountToken200ResponseFromJSON,
RegenerateAccountToken200ResponseToJSON,
RemoveOrganizationMemberRequestFromJSON,
RemoveOrganizationMemberRequestToJSON,
UpdateFrontendRequestFromJSON,
@ -149,7 +152,7 @@ export class AdminApi extends runtime.BaseAPI {
/**
*/
async createAccountRaw(requestParameters: CreateAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<VerifyRequest>> {
async createAccountRaw(requestParameters: CreateAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RegenerateAccountToken200Response>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
@ -168,12 +171,12 @@ export class AdminApi extends runtime.BaseAPI {
body: LoginRequestToJSON(requestParameters['body']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => VerifyRequestFromJSON(jsonValue));
return new runtime.JSONApiResponse(response, (jsonValue) => RegenerateAccountToken200ResponseFromJSON(jsonValue));
}
/**
*/
async createAccount(requestParameters: CreateAccountRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<VerifyRequest> {
async createAccount(requestParameters: CreateAccountRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RegenerateAccountToken200Response> {
const response = await this.createAccountRaw(requestParameters, initOverrides);
return await response.value();
}