Skip to content

Commit

Permalink
Replace derive endpoint with query
Browse files Browse the repository at this point in the history
  • Loading branch information
chelseapinka committed Dec 9, 2024
1 parent 46b853b commit 6779eb4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions src/gConsent/manage/getAccessGrantAll.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe("getAccessGrantAll", () => {
expect(getVerifiableCredentialAllFromShape).toHaveBeenCalled();

expect(getVerifiableCredentialAllFromShape).toHaveBeenCalledWith(
"https://some.api.endpoint/derive",
"https://some.api.endpoint/query",
expect.objectContaining(expectedDefaultVcShape),
expect.objectContaining({
// Expecting fetch to match universal-fetch fails in node because the
Expand All @@ -106,13 +106,13 @@ describe("getAccessGrantAll", () => {

await getAccessGrantAll(
{ requestor },
{ accessEndpoint: "https://some.api.endpoint/derive" },
{ accessEndpoint: "https://some.api.endpoint/query" },
);

expect(getVerifiableCredentialAllFromShape).toHaveBeenCalled();

expect(getVerifiableCredentialAllFromShape).toHaveBeenCalledWith(
"https://some.api.endpoint/derive",
"https://some.api.endpoint/query",
expect.objectContaining(expectedDefaultVcShape),
expect.objectContaining({
// Expecting fetch to match universal-fetch fails in node because the
Expand Down Expand Up @@ -153,7 +153,7 @@ describe("getAccessGrantAll", () => {
expect(getVerifiableCredentialAllFromShape).toHaveBeenCalled();

expect(getVerifiableCredentialAllFromShape).toHaveBeenCalledWith(
"https://some.api.endpoint/derive",
"https://some.api.endpoint/query",
expect.objectContaining(expectedVcShape),
{
fetch: otherFetch,
Expand Down Expand Up @@ -188,7 +188,7 @@ describe("getAccessGrantAll", () => {
expect(getVerifiableCredentialAllFromShape).toHaveBeenCalled();

expect(getVerifiableCredentialAllFromShape).toHaveBeenCalledWith(
"https://some.api.endpoint/derive",
"https://some.api.endpoint/query",
expect.objectContaining(expectedVcShape),
{
fetch: otherFetch,
Expand Down Expand Up @@ -223,7 +223,7 @@ describe("getAccessGrantAll", () => {
expect(getVerifiableCredentialAllFromShape).toHaveBeenCalled();

expect(getVerifiableCredentialAllFromShape).toHaveBeenCalledWith(
"https://some.api.endpoint/derive",
"https://some.api.endpoint/query",
expect.objectContaining(expectedVcShape),
{
fetch: otherFetch,
Expand Down Expand Up @@ -258,7 +258,7 @@ describe("getAccessGrantAll", () => {
expect(getVerifiableCredentialAllFromShape).toHaveBeenCalledTimes(4);

expect(getVerifiableCredentialAllFromShape).toHaveBeenCalledWith(
"https://some.api.endpoint/derive",
"https://some.api.endpoint/query",
expect.objectContaining(expectedVcShapeOpen),
{
fetch: otherFetch,
Expand Down Expand Up @@ -296,7 +296,7 @@ describe("getAccessGrantAll", () => {
expect(getVerifiableCredentialAllFromShape).toHaveBeenCalled();

expect(getVerifiableCredentialAllFromShape).toHaveBeenCalledWith(
"https://some.api.endpoint/derive",
"https://some.api.endpoint/query",
expect.objectContaining(expectedVcShape),
{
fetch: otherFetch,
Expand Down Expand Up @@ -334,7 +334,7 @@ describe("getAccessGrantAll", () => {
expect(getVerifiableCredentialAllFromShape).toHaveBeenCalled();

expect(getVerifiableCredentialAllFromShape).toHaveBeenCalledWith(
"https://some.api.endpoint/derive",
"https://some.api.endpoint/query",
expect.objectContaining(expectedVcShape),
{
fetch: otherFetch,
Expand All @@ -353,7 +353,7 @@ describe("getAccessGrantAll", () => {
},
);
expect(getVerifiableCredentialAllFromShape).toHaveBeenCalledWith(
"https://some.api.endpoint/derive",
"https://some.api.endpoint/query",
expect.anything(),
expect.objectContaining({
// FIXME: expecting fetch to match crossFetch fails in node.
Expand Down
4 changes: 2 additions & 2 deletions src/gConsent/manage/getAccessGrantAll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ async function getAccessGrantAll(
const sessionFetch = await getSessionFetch(options);
// TODO: Fix access API endpoint retrieval (should include all the different API endpoints)
const queryEndpoint = options.accessEndpoint
? new URL("derive", options.accessEndpoint)
? new URL("query", options.accessEndpoint)
: new URL(
"derive",
"query",
await getAccessApiEndpoint(params.resource as string, options),
);

Expand Down

0 comments on commit 6779eb4

Please sign in to comment.