Skip to content

Commit

Permalink
Merge pull request #36 from equinor/fix/corrected-key-for-impersonate
Browse files Browse the repository at this point in the history
🔧 Corrected how to send key in impersonate
  • Loading branch information
AmandaElvkull authored Sep 12, 2024
2 parents 5ae37fc + 96a8a4d commit eca5181
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 27 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@equinor/subsurface-app-management",
"version": "1.1.13",
"version": "1.1.14",
"description": "React Typescript components/hooks to communicate with equinor/sam",
"types": "dist/index.d.ts",
"type": "module",
Expand Down
12 changes: 0 additions & 12 deletions src/api/core/OpenAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,3 @@ export const OpenAPI_Portal_Prod: OpenAPIConfig = {
HEADERS: undefined,
ENCODE_PATH: undefined,
};

export const OpenAPI_userImpersonate: OpenAPIConfig = {
BASE: `https://api-amplify-portal-${noLocalhostEnvironmentName}.radix.equinor.com`,
VERSION: '1.0',
WITH_CREDENTIALS: false,
CREDENTIALS: 'include',
TOKEN: getPortalProdToken,
USERNAME: undefined,
PASSWORD: undefined,
HEADERS: { key: 'userImpersonation' },
ENCODE_PATH: undefined,
};
24 changes: 12 additions & 12 deletions src/api/services/ImpersonateUserService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import type { ImpersonateUserDto } from 'src/api/models/ImpersonateUserDto';
import type { ImpersonateUserUpdateDto } from 'src/api/models/ImpersonateUserUpdateDto';
import type { CancelablePromise } from 'src/api';
import { OpenAPI_userImpersonate } from '../core/OpenAPI';
import { OpenAPI_Portal } from '../core/OpenAPI';
import { request as __request } from '../core/request';
export class ImpersonateUserService {
/**
Expand All @@ -16,7 +16,7 @@ export class ImpersonateUserService {
public static getApiV1ImpersonateUser(): CancelablePromise<
Array<ImpersonateUserDto>
> {
return __request(OpenAPI_userImpersonate, {
return __request(OpenAPI_Portal, {
method: 'GET',
url: '/api/v1/ImpersonateUser',
errors: {
Expand All @@ -33,7 +33,7 @@ export class ImpersonateUserService {
public static createImpersonateUser(
requestBody?: ImpersonateUserUpdateDto
): CancelablePromise<ImpersonateUserDto> {
return __request(OpenAPI_userImpersonate, {
return __request(OpenAPI_Portal, {
method: 'POST',
url: '/api/v1/ImpersonateUser',
body: requestBody,
Expand All @@ -54,7 +54,7 @@ export class ImpersonateUserService {
public static putImpersonateUser(
requestBody?: ImpersonateUserDto
): CancelablePromise<ImpersonateUserDto> {
return __request(OpenAPI_userImpersonate, {
return __request(OpenAPI_Portal, {
method: 'PUT',
url: '/api/v1/ImpersonateUser',
body: requestBody,
Expand All @@ -73,7 +73,7 @@ export class ImpersonateUserService {
public static getApiV1ImpersonateUserGetImpersonateUserForApp(
appName: string
): CancelablePromise<Array<ImpersonateUserDto>> {
return __request(OpenAPI_userImpersonate, {
return __request(OpenAPI_Portal, {
method: 'GET',
url: '/api/v1/ImpersonateUser/GetImpersonateUserForApp/{appName}',
path: {
Expand All @@ -91,7 +91,7 @@ export class ImpersonateUserService {
* @throws ApiError
*/
public static getAllActiveUsers(): CancelablePromise<ImpersonateUserDto> {
return __request(OpenAPI_userImpersonate, {
return __request(OpenAPI_Portal, {
method: 'GET',
url: '/api/v1/ImpersonateUser/ActiveUsers',
errors: {
Expand All @@ -106,7 +106,7 @@ export class ImpersonateUserService {
* @throws ApiError
*/
public static getActiveUser(): CancelablePromise<ImpersonateUserDto> {
return __request(OpenAPI_userImpersonate, {
return __request(OpenAPI_Portal, {
method: 'GET',
url: '/api/v1/ImpersonateUser/ActiveUser',
errors: {
Expand All @@ -124,7 +124,7 @@ export class ImpersonateUserService {
public static getImpersonateUserById(
id?: string
): CancelablePromise<ImpersonateUserDto> {
return __request(OpenAPI_userImpersonate, {
return __request(OpenAPI_Portal, {
method: 'GET',
url: '/api/v1/ImpersonateUser/ImpersonateUser',
query: {
Expand All @@ -145,7 +145,7 @@ export class ImpersonateUserService {
public static getImpersonateUserByUserName(
username?: string
): CancelablePromise<ImpersonateUserDto> {
return __request(OpenAPI_userImpersonate, {
return __request(OpenAPI_Portal, {
method: 'GET',
url: '/api/v1/ImpersonateUser/ImpersonateUserByUserName',
query: {
Expand All @@ -162,7 +162,7 @@ export class ImpersonateUserService {
* @throws ApiError
*/
public static canImpersonate(): CancelablePromise<boolean> {
return __request(OpenAPI_userImpersonate, {
return __request(OpenAPI_Portal, {
method: 'GET',
url: '/api/v1/ImpersonateUser/CanImpersonate',
errors: {
Expand All @@ -180,7 +180,7 @@ export class ImpersonateUserService {
public static startImpersonating(
username?: string
): CancelablePromise<ImpersonateUserDto> {
return __request(OpenAPI_userImpersonate, {
return __request(OpenAPI_Portal, {
method: 'PUT',
url: '/api/v1/ImpersonateUser/StartImpersonating',
query: {
Expand All @@ -198,7 +198,7 @@ export class ImpersonateUserService {
* @throws ApiError
*/
public static stopImpersonating(): CancelablePromise<ImpersonateUserDto> {
return __request(OpenAPI_userImpersonate, {
return __request(OpenAPI_Portal, {
method: 'PUT',
url: '/api/v1/ImpersonateUser/StopImpersonating',
errors: {
Expand Down

0 comments on commit eca5181

Please sign in to comment.