feat: remove authName from HoppRESTAuth type definitions
This commit is contained in:
@@ -1,13 +1,9 @@
|
||||
export type HoppRESTAuthNone = {
|
||||
authType: "none"
|
||||
authName: "None"
|
||||
authActive: true
|
||||
}
|
||||
|
||||
export type HoppRESTAuthBasic = {
|
||||
authType: "basic"
|
||||
authName: "Basic Auth"
|
||||
authActive: true
|
||||
|
||||
username: string
|
||||
password: string
|
||||
@@ -15,13 +11,13 @@ export type HoppRESTAuthBasic = {
|
||||
|
||||
export type HoppRESTAuthBearer = {
|
||||
authType: "bearer"
|
||||
authName: "Bearer Token"
|
||||
authActive: true
|
||||
|
||||
token: string
|
||||
}
|
||||
|
||||
export type HoppRESTAuth =
|
||||
{ authActive: boolean } & (
|
||||
| HoppRESTAuthNone
|
||||
| HoppRESTAuthBasic
|
||||
| HoppRESTAuthBearer
|
||||
)
|
||||
|
||||
@@ -124,14 +124,12 @@ export function parseOldAuth(x: any): HoppRESTAuth {
|
||||
if (!x.auth || x.auth === "None")
|
||||
return {
|
||||
authType: "none",
|
||||
authName: "None",
|
||||
authActive: true,
|
||||
}
|
||||
|
||||
if (x.auth === "Basic Auth")
|
||||
return {
|
||||
authType: "basic",
|
||||
authName: "Basic Auth",
|
||||
authActive: true,
|
||||
username: x.httpUser,
|
||||
password: x.httpPassword,
|
||||
@@ -140,10 +138,9 @@ export function parseOldAuth(x: any): HoppRESTAuth {
|
||||
if (x.auth === "Bearer Token")
|
||||
return {
|
||||
authType: "bearer",
|
||||
authName: "Bearer Token",
|
||||
authActive: true,
|
||||
token: x.bearerToken,
|
||||
}
|
||||
|
||||
return { authType: "none", authName: "None", authActive: true }
|
||||
return { authType: "none", authActive: true }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user