Skip to content

Commit

Permalink
fix: collection level authorization inheritance issue (#3852)
Browse files Browse the repository at this point in the history
  • Loading branch information
anwarulislam authored and AndrewBastin committed Feb 23, 2024
1 parent 6827e97 commit bd40661
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 48 deletions.
Expand Up @@ -614,8 +614,8 @@ const addNewRootCollection = (name: string) => {
requests: [],
headers: [],
auth: {
authType: "inherit",
authActive: false,
authType: "none",
authActive: true,
},
})
)
Expand Down
20 changes: 10 additions & 10 deletions packages/hoppscotch-common/src/components/graphql/Authorization.vue
Expand Up @@ -32,24 +32,24 @@
@keyup.escape="hide()"
>
<HoppSmartItem
label="None"
:icon="authName === 'None' ? IconCircleDot : IconCircle"
:active="authName === 'None'"
v-if="!isRootCollection"
label="Inherit"
:icon="authName === 'Inherit' ? IconCircleDot : IconCircle"
:active="authName === 'Inherit'"
@click="
() => {
auth.authType = 'none'
auth.authType = 'inherit'
hide()
}
"
/>
<HoppSmartItem
v-if="!isRootCollection"
label="Inherit"
:icon="authName === 'Inherit' ? IconCircleDot : IconCircle"
:active="authName === 'Inherit'"
label="None"
:icon="authName === 'None' ? IconCircleDot : IconCircle"
:active="authName === 'None'"
@click="
() => {
auth.authType = 'inherit'
auth.authType = 'none'
hide()
}
"
Expand Down Expand Up @@ -284,7 +284,7 @@ const authActive = pluckRef(auth, "authActive")
const clearContent = () => {
auth.value = {
authType: "none",
authType: "inherit",
authActive: true,
}
}
Expand Down
20 changes: 10 additions & 10 deletions packages/hoppscotch-common/src/components/http/Authorization.vue
Expand Up @@ -32,24 +32,24 @@
@keyup.escape="hide()"
>
<HoppSmartItem
label="None"
:icon="authName === 'None' ? IconCircleDot : IconCircle"
:active="authName === 'None'"
v-if="!isRootCollection"
label="Inherit"
:icon="authName === 'Inherit' ? IconCircleDot : IconCircle"
:active="authName === 'Inherit'"
@click="
() => {
auth.authType = 'none'
auth.authType = 'inherit'
hide()
}
"
/>
<HoppSmartItem
v-if="!isRootCollection"
label="Inherit"
:icon="authName === 'Inherit' ? IconCircleDot : IconCircle"
:active="authName === 'Inherit'"
label="None"
:icon="authName === 'None' ? IconCircleDot : IconCircle"
:active="authName === 'None'"
@click="
() => {
auth.authType = 'inherit'
auth.authType = 'none'
hide()
}
"
Expand Down Expand Up @@ -265,7 +265,7 @@ const authActive = pluckRef(auth, "authActive")
const clearContent = () => {
auth.value = {
authType: "none",
authType: "inherit",
authActive: true,
}
}
Expand Down
Expand Up @@ -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([
Expand Down Expand Up @@ -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,
Expand All @@ -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}`,
Expand All @@ -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,
Expand Down Expand Up @@ -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: [
Expand Down Expand Up @@ -301,7 +301,7 @@ const samples = [
name: "Untitled",
endpoint: "http://localhost:9900/",
auth: {
authType: "none",
authType: "inherit",
authActive: true,
},
body: {
Expand Down Expand Up @@ -345,7 +345,7 @@ const samples = [
endpoint: "https://hoppscotch.io/?io",
auth: {
authActive: true,
authType: "none",
authType: "inherit",
},
body: {
contentType: null,
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -441,7 +441,7 @@ const samples = [
endpoint: "http://localhost/",
auth: {
authActive: true,
authType: "none",
authType: "inherit",
},
body: {
contentType: "multipart/form-data",
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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([
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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: [],
Expand All @@ -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",
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -756,7 +756,7 @@ const samples = [
name: "Untitled",
endpoint: "https://google.com/",
auth: {
authType: "none",
authType: "inherit",
authActive: true,
},
body: {
Expand All @@ -777,7 +777,7 @@ const samples = [
name: "Untitled",
endpoint: "https://google.com/",
auth: {
authType: "none",
authType: "inherit",
authActive: true,
},
body: {
Expand All @@ -797,7 +797,7 @@ const samples = [
name: "Untitled",
endpoint: "http://192.168.0.24:8080/ping",
auth: {
authType: "none",
authType: "inherit",
authActive: true,
},
body: {
Expand All @@ -817,7 +817,7 @@ const samples = [
name: "Untitled",
endpoint: "https://example.com/",
auth: {
authType: "none",
authType: "inherit",
authActive: true,
},
body: {
Expand Down
2 changes: 1 addition & 1 deletion packages/hoppscotch-common/src/helpers/graphql/default.ts
Expand Up @@ -27,7 +27,7 @@ export const getDefaultGQLRequest = (): HoppGQLRequest => ({
}`,
query: DEFAULT_QUERY,
auth: {
authType: "none",
authType: "inherit",
authActive: true,
},
})
2 changes: 1 addition & 1 deletion packages/hoppscotch-common/src/helpers/rest/default.ts
Expand Up @@ -8,7 +8,7 @@ export const getDefaultRESTRequest = (): HoppRESTRequest => ({
headers: [],
method: "GET",
auth: {
authType: "none",
authType: "inherit",
authActive: true,
},
preRequestScript: "",
Expand Down
2 changes: 1 addition & 1 deletion packages/hoppscotch-data/src/graphql/index.ts
Expand Up @@ -57,7 +57,7 @@ export function getDefaultGQLRequest(): HoppGQLRequest {
}`.trim(),
query: DEFAULT_QUERY,
auth: {
authType: "none",
authType: "inherit",
authActive: true,
},
}
Expand Down
2 changes: 1 addition & 1 deletion packages/hoppscotch-data/src/rest/index.ts
Expand Up @@ -167,7 +167,7 @@ export function getDefaultRESTRequest(): HoppRESTRequest {
headers: [],
method: "GET",
auth: {
authType: "none",
authType: "inherit",
authActive: true,
},
preRequestScript: "",
Expand Down

0 comments on commit bd40661

Please sign in to comment.