@Immutable @ThreadSafe public final class CloudFrontUtilities extends Object
To securely serve private content by using CloudFront, you can require that users access your private content by using special CloudFront signed URLs or signed cookies. You then develop your application either to create and distribute signed URLs to authenticated users or to send Set-Cookie headers that set signed cookies for authenticated users.
Signed URLs take precedence over signed cookies. If you use both signed URLs and signed cookies to control access to the same files and a viewer uses a signed URL to request a file, CloudFront determines whether to return the file to the viewer based only on the signed URL.
| Modifier and Type | Method and Description |
|---|---|
static CloudFrontUtilities |
create() |
CookiesForCannedPolicy |
getCookiesForCannedPolicy(CannedSignerRequest request)
Generate signed cookies that allows access to a specific distribution and
resource path by applying access restrictions from a "canned" (simplified)
policy document.
|
CookiesForCannedPolicy |
getCookiesForCannedPolicy(Consumer<CannedSignerRequest.Builder> request)
Generate signed cookies that allows access to a specific distribution and
resource path by applying access restrictions from a "canned" (simplified)
policy document.
|
CookiesForCustomPolicy |
getCookiesForCustomPolicy(Consumer<CustomSignerRequest.Builder> request)
Returns signed cookies that provides tailored access to private content based on an access time window and an ip range.
|
CookiesForCustomPolicy |
getCookiesForCustomPolicy(CustomSignerRequest request)
Returns signed cookies that provides tailored access to private content based on an access time window and an ip range.
|
SignedUrl |
getSignedUrlWithCannedPolicy(CannedSignerRequest request)
Returns a signed URL with a canned policy that grants universal access to
private content until a given date.
|
SignedUrl |
getSignedUrlWithCannedPolicy(Consumer<CannedSignerRequest.Builder> request)
Returns a signed URL with a canned policy that grants universal access to
private content until a given date.
|
SignedUrl |
getSignedUrlWithCustomPolicy(Consumer<CustomSignerRequest.Builder> request)
Returns a signed URL that provides tailored access to private content
based on an access time window and an ip range.
|
SignedUrl |
getSignedUrlWithCustomPolicy(CustomSignerRequest request)
Returns a signed URL that provides tailored access to private content
based on an access time window and an ip range.
|
public static CloudFrontUtilities create()
public SignedUrl getSignedUrlWithCannedPolicy(Consumer<CannedSignerRequest.Builder> request)
This is a convenience which creates an instance of the CannedSignerRequest.Builder avoiding the need to
create one manually via CannedSignerRequest.builder()
request - A Consumer that will call methods on CannedSignerRequest.Builder to create a request.Example Usage
public SignedUrl getSignedUrlWithCannedPolicy(CannedSignerRequest request)
request - A CannedSignerRequest configured with the following values:
resourceUrl, privateKey, keyPairId, expirationDateExample Usage
public SignedUrl getSignedUrlWithCustomPolicy(Consumer<CustomSignerRequest.Builder> request)
This is a convenience which creates an instance of the CustomSignerRequest.Builder avoiding the need to
create one manually via CustomSignerRequest.builder()
request - A Consumer that will call methods on CustomSignerRequest.Builder to create a request.Example Usage
public SignedUrl getSignedUrlWithCustomPolicy(CustomSignerRequest request)
request - A CustomSignerRequest configured with the following values:
resourceUrl, privateKey, keyPairId, expirationDate, activeDate (optional), ipRange (optional)Example Usage
public CookiesForCannedPolicy getCookiesForCannedPolicy(Consumer<CannedSignerRequest.Builder> request)
This is a convenience which creates an instance of the CannedSignerRequest.Builder avoiding the need to
create one manually via CannedSignerRequest.builder()
request - A Consumer that will call methods on CannedSignerRequest.Builder to create a request.Example Usage
public CookiesForCannedPolicy getCookiesForCannedPolicy(CannedSignerRequest request)
request - A CannedSignerRequest configured with the following values:
resourceUrl, privateKey, keyPairId, expirationDateExample Usage
public CookiesForCustomPolicy getCookiesForCustomPolicy(Consumer<CustomSignerRequest.Builder> request)
This is a convenience which creates an instance of the CustomSignerRequest.Builder avoiding the need to
create one manually via CustomSignerRequest.builder()
request - A Consumer that will call methods on CustomSignerRequest.Builder to create a request.Example Usage
public CookiesForCustomPolicy getCookiesForCustomPolicy(CustomSignerRequest request)
request - A CustomSignerRequest configured with the following values:
resourceUrl, privateKey, keyPairId, expirationDate, activeDate (optional), ipRange (optional)Example Usage
Copyright © 2023. All rights reserved.