Skip to content

Commit

Permalink
chore: change import statements
Browse files Browse the repository at this point in the history
  • Loading branch information
Venkata Ramyasri Kota committed Sep 6, 2023
1 parent 8e70480 commit f5ca3c9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/storage/src/providers/s3/apis/internal/getUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import { getPresignedGetObjectUrl } from '../../utils/client';
import { getProperties } from './getProperties';
import { resolveS3ConfigAndInput } from '../../utils';
import { assertValidationError } from '../../../../errors/utils/assertValidationError';

const DEFAULT_PRESIGN_EXPIRATION = 900;
const MAX_URL_EXPIRATION = 900;
import {
DEFAULT_PRESIGN_EXPIRATION,
MAX_URL_EXPIRATION,
} from '../../utils/constants';

export const getUrl = async function (
amplify: AmplifyClassV6,
Expand All @@ -37,8 +38,9 @@ export const getUrl = async function (
);
urlExpirationInSec = Math.min(awsCredExpirationInSec, urlExpirationInSec);
}
const maxUrlExpirationInSec = MAX_URL_EXPIRATION / 1000;
assertValidationError(
!(urlExpirationInSec > MAX_URL_EXPIRATION),
!(urlExpirationInSec > maxUrlExpirationInSec),
StorageValidationErrorCode.UrlExpirationMaxLimitExceed
);

Expand Down

0 comments on commit f5ca3c9

Please sign in to comment.