mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
feat: add method for migrating proxies without environment validation (#2056)
This commit is contained in:
parent
e6e6da6a44
commit
721cd20b5d
@ -171,6 +171,18 @@ export class ApiTokenService {
|
||||
return this.insertNewApiToken(createNewToken);
|
||||
}
|
||||
|
||||
// TODO: Remove this service method after embedded proxy has been released in
|
||||
// 4.16.0
|
||||
public async createMigratedProxyApiToken(
|
||||
newToken: Omit<IApiTokenCreate, 'secret'>,
|
||||
): Promise<IApiToken> {
|
||||
validateApiToken(newToken);
|
||||
|
||||
const secret = this.generateSecretKey(newToken);
|
||||
const createNewToken = { ...newToken, secret };
|
||||
return this.insertNewApiToken(createNewToken);
|
||||
}
|
||||
|
||||
private async insertNewApiToken(
|
||||
newApiToken: IApiTokenCreate,
|
||||
): Promise<IApiToken> {
|
||||
|
Loading…
Reference in New Issue
Block a user