fix: collection level authorization inheritance issue (#3852)
This commit is contained in:
committed by
Andrew Bastin
parent
6827e97ec5
commit
bd406616ec
@@ -614,8 +614,8 @@ const addNewRootCollection = (name: string) => {
|
||||
requests: [],
|
||||
headers: [],
|
||||
auth: {
|
||||
authType: "inherit",
|
||||
authActive: false,
|
||||
authType: "none",
|
||||
authActive: true,
|
||||
},
|
||||
})
|
||||
)
|
||||
|
||||
@@ -31,17 +31,6 @@
|
||||
tabindex="0"
|
||||
@keyup.escape="hide()"
|
||||
>
|
||||
<HoppSmartItem
|
||||
label="None"
|
||||
:icon="authName === 'None' ? IconCircleDot : IconCircle"
|
||||
:active="authName === 'None'"
|
||||
@click="
|
||||
() => {
|
||||
auth.authType = 'none'
|
||||
hide()
|
||||
}
|
||||
"
|
||||
/>
|
||||
<HoppSmartItem
|
||||
v-if="!isRootCollection"
|
||||
label="Inherit"
|
||||
@@ -54,6 +43,17 @@
|
||||
}
|
||||
"
|
||||
/>
|
||||
<HoppSmartItem
|
||||
label="None"
|
||||
:icon="authName === 'None' ? IconCircleDot : IconCircle"
|
||||
:active="authName === 'None'"
|
||||
@click="
|
||||
() => {
|
||||
auth.authType = 'none'
|
||||
hide()
|
||||
}
|
||||
"
|
||||
/>
|
||||
<HoppSmartItem
|
||||
label="Basic Auth"
|
||||
:icon="authName === 'Basic Auth' ? IconCircleDot : IconCircle"
|
||||
@@ -284,7 +284,7 @@ const authActive = pluckRef(auth, "authActive")
|
||||
|
||||
const clearContent = () => {
|
||||
auth.value = {
|
||||
authType: "none",
|
||||
authType: "inherit",
|
||||
authActive: true,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,17 +31,6 @@
|
||||
tabindex="0"
|
||||
@keyup.escape="hide()"
|
||||
>
|
||||
<HoppSmartItem
|
||||
label="None"
|
||||
:icon="authName === 'None' ? IconCircleDot : IconCircle"
|
||||
:active="authName === 'None'"
|
||||
@click="
|
||||
() => {
|
||||
auth.authType = 'none'
|
||||
hide()
|
||||
}
|
||||
"
|
||||
/>
|
||||
<HoppSmartItem
|
||||
v-if="!isRootCollection"
|
||||
label="Inherit"
|
||||
@@ -54,6 +43,17 @@
|
||||
}
|
||||
"
|
||||
/>
|
||||
<HoppSmartItem
|
||||
label="None"
|
||||
:icon="authName === 'None' ? IconCircleDot : IconCircle"
|
||||
:active="authName === 'None'"
|
||||
@click="
|
||||
() => {
|
||||
auth.authType = 'none'
|
||||
hide()
|
||||
}
|
||||
"
|
||||
/>
|
||||
<HoppSmartItem
|
||||
label="Basic Auth"
|
||||
:icon="authName === 'Basic Auth' ? IconCircleDot : IconCircle"
|
||||
@@ -265,7 +265,7 @@ const authActive = pluckRef(auth, "authActive")
|
||||
|
||||
const clearContent = () => {
|
||||
auth.value = {
|
||||
authType: "none",
|
||||
authType: "inherit",
|
||||
authActive: true,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ const samples = [
|
||||
method: "GET",
|
||||
name: "Untitled",
|
||||
endpoint: "https://echo.hoppscotch.io/",
|
||||
auth: { authType: "none", authActive: true },
|
||||
auth: { authType: "inherit", authActive: true },
|
||||
body: {
|
||||
contentType: "application/x-www-form-urlencoded",
|
||||
body: rawKeyValueEntriesToString([
|
||||
@@ -149,7 +149,7 @@ const samples = [
|
||||
method: "GET",
|
||||
name: "Untitled",
|
||||
endpoint: "https://google.com/",
|
||||
auth: { authType: "none", authActive: true },
|
||||
auth: { authType: "inherit", authActive: true },
|
||||
body: {
|
||||
contentType: null,
|
||||
body: null,
|
||||
@@ -166,7 +166,7 @@ const samples = [
|
||||
method: "POST",
|
||||
name: "Untitled",
|
||||
endpoint: "http://localhost:1111/hello/world/?buzz",
|
||||
auth: { authType: "none", authActive: true },
|
||||
auth: { authType: "inherit", authActive: true },
|
||||
body: {
|
||||
contentType: "application/json",
|
||||
body: `{\n "foo": "bar"\n}`,
|
||||
@@ -189,7 +189,7 @@ const samples = [
|
||||
method: "GET",
|
||||
name: "Untitled",
|
||||
endpoint: "https://example.com/",
|
||||
auth: { authType: "none", authActive: true },
|
||||
auth: { authType: "inherit", authActive: true },
|
||||
body: {
|
||||
contentType: null,
|
||||
body: null,
|
||||
@@ -217,7 +217,7 @@ const samples = [
|
||||
method: "POST",
|
||||
name: "Untitled",
|
||||
endpoint: "https://bing.com/",
|
||||
auth: { authType: "none", authActive: true },
|
||||
auth: { authType: "inherit", authActive: true },
|
||||
body: {
|
||||
contentType: "multipart/form-data",
|
||||
body: [
|
||||
@@ -301,7 +301,7 @@ const samples = [
|
||||
name: "Untitled",
|
||||
endpoint: "http://localhost:9900/",
|
||||
auth: {
|
||||
authType: "none",
|
||||
authType: "inherit",
|
||||
authActive: true,
|
||||
},
|
||||
body: {
|
||||
@@ -345,7 +345,7 @@ const samples = [
|
||||
endpoint: "https://hoppscotch.io/?io",
|
||||
auth: {
|
||||
authActive: true,
|
||||
authType: "none",
|
||||
authType: "inherit",
|
||||
},
|
||||
body: {
|
||||
contentType: null,
|
||||
@@ -380,7 +380,7 @@ const samples = [
|
||||
endpoint: "https://someshadywebsite.com/questionable/path/?so",
|
||||
auth: {
|
||||
authActive: true,
|
||||
authType: "none",
|
||||
authType: "inherit",
|
||||
},
|
||||
body: {
|
||||
contentType: "multipart/form-data",
|
||||
@@ -441,7 +441,7 @@ const samples = [
|
||||
endpoint: "http://localhost/",
|
||||
auth: {
|
||||
authActive: true,
|
||||
authType: "none",
|
||||
authType: "inherit",
|
||||
},
|
||||
body: {
|
||||
contentType: "multipart/form-data",
|
||||
@@ -473,7 +473,7 @@ const samples = [
|
||||
method: "GET",
|
||||
name: "Untitled",
|
||||
endpoint: "https://hoppscotch.io/",
|
||||
auth: { authType: "none", authActive: true },
|
||||
auth: { authType: "inherit", authActive: true },
|
||||
body: {
|
||||
contentType: null,
|
||||
body: null,
|
||||
@@ -528,7 +528,7 @@ const samples = [
|
||||
method: "GET",
|
||||
name: "Untitled",
|
||||
endpoint: "https://echo.hoppscotch.io/",
|
||||
auth: { authType: "none", authActive: true },
|
||||
auth: { authType: "inherit", authActive: true },
|
||||
body: {
|
||||
contentType: "application/x-www-form-urlencoded",
|
||||
body: rawKeyValueEntriesToString([
|
||||
@@ -573,7 +573,7 @@ const samples = [
|
||||
name: "Untitled",
|
||||
endpoint: "https://echo.hoppscotch.io/",
|
||||
method: "POST",
|
||||
auth: { authType: "none", authActive: true },
|
||||
auth: { authType: "inherit", authActive: true },
|
||||
headers: [
|
||||
{
|
||||
active: true,
|
||||
@@ -615,7 +615,7 @@ const samples = [
|
||||
name: "Untitled",
|
||||
endpoint: "https://muxueqz.top/skybook.html",
|
||||
method: "GET",
|
||||
auth: { authType: "none", authActive: true },
|
||||
auth: { authType: "inherit", authActive: true },
|
||||
headers: [],
|
||||
body: { contentType: null, body: null },
|
||||
params: [],
|
||||
@@ -629,7 +629,7 @@ const samples = [
|
||||
name: "Untitled",
|
||||
endpoint: "https://echo.hoppscotch.io/",
|
||||
method: "POST",
|
||||
auth: { authType: "none", authActive: true },
|
||||
auth: { authType: "inherit", authActive: true },
|
||||
headers: [],
|
||||
body: {
|
||||
contentType: "multipart/form-data",
|
||||
@@ -653,7 +653,7 @@ const samples = [
|
||||
name: "Untitled",
|
||||
endpoint: "http://127.0.0.1/",
|
||||
method: "CUSTOMMETHOD",
|
||||
auth: { authType: "none", authActive: true },
|
||||
auth: { authType: "inherit", authActive: true },
|
||||
headers: [],
|
||||
body: {
|
||||
contentType: null,
|
||||
@@ -670,7 +670,7 @@ const samples = [
|
||||
name: "Untitled",
|
||||
endpoint: "https://echo.hoppscotch.io/",
|
||||
method: "GET",
|
||||
auth: { authType: "none", authActive: true },
|
||||
auth: { authType: "inherit", authActive: true },
|
||||
headers: [
|
||||
{
|
||||
active: true,
|
||||
@@ -693,7 +693,7 @@ const samples = [
|
||||
name: "Untitled",
|
||||
endpoint: "https://echo.hoppscotch.io/",
|
||||
method: "GET",
|
||||
auth: { authType: "none", authActive: true },
|
||||
auth: { authType: "inherit", authActive: true },
|
||||
headers: [],
|
||||
body: {
|
||||
contentType: null,
|
||||
@@ -710,7 +710,7 @@ const samples = [
|
||||
name: "Untitled",
|
||||
endpoint: "https://example.org/",
|
||||
method: "HEAD",
|
||||
auth: { authType: "none", authActive: true },
|
||||
auth: { authType: "inherit", authActive: true },
|
||||
headers: [],
|
||||
body: {
|
||||
contentType: null,
|
||||
@@ -756,7 +756,7 @@ const samples = [
|
||||
name: "Untitled",
|
||||
endpoint: "https://google.com/",
|
||||
auth: {
|
||||
authType: "none",
|
||||
authType: "inherit",
|
||||
authActive: true,
|
||||
},
|
||||
body: {
|
||||
@@ -777,7 +777,7 @@ const samples = [
|
||||
name: "Untitled",
|
||||
endpoint: "https://google.com/",
|
||||
auth: {
|
||||
authType: "none",
|
||||
authType: "inherit",
|
||||
authActive: true,
|
||||
},
|
||||
body: {
|
||||
@@ -797,7 +797,7 @@ const samples = [
|
||||
name: "Untitled",
|
||||
endpoint: "http://192.168.0.24:8080/ping",
|
||||
auth: {
|
||||
authType: "none",
|
||||
authType: "inherit",
|
||||
authActive: true,
|
||||
},
|
||||
body: {
|
||||
@@ -817,7 +817,7 @@ const samples = [
|
||||
name: "Untitled",
|
||||
endpoint: "https://example.com/",
|
||||
auth: {
|
||||
authType: "none",
|
||||
authType: "inherit",
|
||||
authActive: true,
|
||||
},
|
||||
body: {
|
||||
|
||||
@@ -27,7 +27,7 @@ export const getDefaultGQLRequest = (): HoppGQLRequest => ({
|
||||
}`,
|
||||
query: DEFAULT_QUERY,
|
||||
auth: {
|
||||
authType: "none",
|
||||
authType: "inherit",
|
||||
authActive: true,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -8,7 +8,7 @@ export const getDefaultRESTRequest = (): HoppRESTRequest => ({
|
||||
headers: [],
|
||||
method: "GET",
|
||||
auth: {
|
||||
authType: "none",
|
||||
authType: "inherit",
|
||||
authActive: true,
|
||||
},
|
||||
preRequestScript: "",
|
||||
|
||||
@@ -57,7 +57,7 @@ export function getDefaultGQLRequest(): HoppGQLRequest {
|
||||
}`.trim(),
|
||||
query: DEFAULT_QUERY,
|
||||
auth: {
|
||||
authType: "none",
|
||||
authType: "inherit",
|
||||
authActive: true,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ export function getDefaultRESTRequest(): HoppRESTRequest {
|
||||
headers: [],
|
||||
method: "GET",
|
||||
auth: {
|
||||
authType: "none",
|
||||
authType: "inherit",
|
||||
authActive: true,
|
||||
},
|
||||
preRequestScript: "",
|
||||
|
||||
Reference in New Issue
Block a user