Skip to content

Commit

Permalink
rename file
Browse files Browse the repository at this point in the history
  • Loading branch information
ashika112 committed Aug 19, 2024
1 parent e4cfb9d commit 67d0101
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { HttpRequest } from '@aws-amplify/core/internals/aws-client-utils';
import {
isIamAuthApplicableForGraphQL,
isIamAuthApplicableForRest,
} from '../../src/utils/iamAuthApplicable';
} from '../../src/utils/isIamAuthApplicable';

describe('iamAuthApplicable', () => {
const url = new URL('https://url');
Expand Down
7 changes: 3 additions & 4 deletions packages/api-rest/src/apis/common/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ type HandlerOptions = Omit<HttpRequest, 'body' | 'headers'> & {
export const transferHandler = async (
amplify: AmplifyClassV6,
options: HandlerOptions & { abortSignal: AbortSignal },
signingServiceInfo?: SigningServiceInfo,
iamAuthApplicable?: (
iamAuthApplicable: (
{ headers }: HttpRequest,
signingServiceInfo?: SigningServiceInfo,
) => boolean,
signingServiceInfo?: SigningServiceInfo,
): Promise<RestApiResponse> => {
const { url, method, headers, body, withCredentials, abortSignal } = options;
const resolvedBody = body
Expand All @@ -67,8 +67,7 @@ export const transferHandler = async (
abortSignal,
};

const isIamAuthApplicable =
iamAuthApplicable && iamAuthApplicable(request, signingServiceInfo);
const isIamAuthApplicable = iamAuthApplicable(request, signingServiceInfo);

let response: RestApiResponse;
const credentials = await resolveCredentials(amplify);
Expand Down
4 changes: 2 additions & 2 deletions packages/api-rest/src/apis/common/internalPost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { AmplifyClassV6 } from '@aws-amplify/core';
import { InternalPostInput, RestApiResponse } from '../../types';
import { createCancellableOperation } from '../../utils';
import { CanceledError } from '../../errors';
import { isIamAuthApplicableForGraphQL } from '../../utils/iamAuthApplicable';
import { isIamAuthApplicableForGraphQL } from '../../utils/isIamAuthApplicable';

import { transferHandler } from './handler';

Expand Down Expand Up @@ -67,8 +67,8 @@ export const post = (
...options,
abortSignal: controller.signal,
},
options?.signingServiceInfo,
isIamAuthApplicableForGraphQL,
options?.signingServiceInfo,
);

return response;
Expand Down
4 changes: 2 additions & 2 deletions packages/api-rest/src/apis/common/publicApis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
parseSigningInfo,
resolveApiUrl,
} from '../../utils';
import { isIamAuthApplicableForRest } from '../../utils/iamAuthApplicable';
import { isIamAuthApplicableForRest } from '../../utils/isIamAuthApplicable';

import { transferHandler } from './handler';

Expand Down Expand Up @@ -72,8 +72,8 @@ const publicHandler = (
headers,
abortSignal,
},
signingServiceInfo,
isIamAuthApplicableForRest,
signingServiceInfo,
);
});

Expand Down

0 comments on commit 67d0101

Please sign in to comment.