Skip to content

Add default bearer signer and stubs for other signers #4003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
5 changes: 5 additions & 0 deletions core/auth/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@
<groupId>software.amazon.eventstream</groupId>
<artifactId>eventstream</artifactId>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>http-auth</artifactId>
<version>${awsjavasdk.version}</version>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
4 changes: 2 additions & 2 deletions core/http-auth-aws-crt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
<artifactId>http-auth-aws-crt</artifactId>
<name>AWS Java SDK :: HTTP Auth AWS CRT</name>
<description>
The AWS SDK for Java - HTTP Auth AWS module contains interfaces and implementations for http authentication
specific to the AWS CRT.
The AWS SDK for Java - HTTP Auth AWS CRT module holds the AWS Common Runtime based implementations
that are used for authentication with HTTP services.
</description>
<url>https://aws.amazon.com/sdkforjava</url>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,23 @@
package software.amazon.awssdk.http.auth.aws.crt;

import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.http.auth.aws.crt.internal.DefaultAwsCrtS3V4aHttpSigner;
import software.amazon.awssdk.http.auth.spi.HttpSigner;
import software.amazon.awssdk.identity.spi.AwsCredentialsIdentity;

/**
* An {@link HttpSigner} that will sign a request using an AWS credentials ({@link AwsCredentialsIdentity}),
* specifically for S3-CRT.
*/
@SdkPublicApi
public interface AwsCrtV4aHttpAuthScheme extends HttpSigner {
public interface AwsCrtS3V4aHttpSigner extends HttpSigner<AwsCredentialsIdentity> {

/**
* Get a default implementation of a {@link AwsCrtS3V4aHttpSigner}
*
* @return AwsCrtS3V4aHttpSigner
*/
static AwsCrtS3V4aHttpSigner create() {
return new DefaultAwsCrtS3V4aHttpSigner();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,23 @@
package software.amazon.awssdk.http.auth.aws.crt;

import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.http.auth.aws.crt.internal.DefaultAwsCrtV4aHttpSigner;
import software.amazon.awssdk.http.auth.spi.HttpSigner;
import software.amazon.awssdk.identity.spi.AwsCredentialsIdentity;

/**
* An {@link HttpSigner} that will sign a request using an AWS credentials ({@link AwsCredentialsIdentity}),
* specifically for CRT.
*/
@SdkPublicApi
public interface AwsCrtS3V4aHttpAuthScheme extends HttpSigner {
public interface AwsCrtV4aHttpSigner extends HttpSigner<AwsCredentialsIdentity> {

/**
* Get a default implementation of a {@link AwsCrtV4aHttpSigner}
*
* @return AwsCrtV4aHttpSigner
*/
static AwsCrtV4aHttpSigner create() {
return new DefaultAwsCrtV4aHttpSigner();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

package software.amazon.awssdk.http.auth.aws.crt.internal;

import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.http.auth.aws.crt.AwsCrtS3V4aHttpSigner;
import software.amazon.awssdk.http.auth.spi.AsyncHttpSignRequest;
import software.amazon.awssdk.http.auth.spi.AsyncSignedHttpRequest;
import software.amazon.awssdk.http.auth.spi.SyncHttpSignRequest;
import software.amazon.awssdk.http.auth.spi.SyncSignedHttpRequest;
import software.amazon.awssdk.identity.spi.AwsCredentialsIdentity;

/**
* A default implementation of {@link AwsCrtS3V4aHttpSigner}.
*/
@SdkInternalApi
public class DefaultAwsCrtS3V4aHttpSigner implements AwsCrtS3V4aHttpSigner {

@Override
public SyncSignedHttpRequest sign(SyncHttpSignRequest<? extends AwsCredentialsIdentity> request) {
throw new UnsupportedOperationException();
}

@Override
public AsyncSignedHttpRequest signAsync(AsyncHttpSignRequest<? extends AwsCredentialsIdentity> request) {
throw new UnsupportedOperationException();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

package software.amazon.awssdk.http.auth.aws.crt.internal;

import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.http.auth.aws.crt.AwsCrtV4aHttpSigner;
import software.amazon.awssdk.http.auth.spi.AsyncHttpSignRequest;
import software.amazon.awssdk.http.auth.spi.AsyncSignedHttpRequest;
import software.amazon.awssdk.http.auth.spi.SyncHttpSignRequest;
import software.amazon.awssdk.http.auth.spi.SyncSignedHttpRequest;
import software.amazon.awssdk.identity.spi.AwsCredentialsIdentity;

/**
* A default implementation of {@link AwsCrtV4aHttpSigner}.
*/
@SdkInternalApi
public class DefaultAwsCrtV4aHttpSigner implements AwsCrtV4aHttpSigner {

@Override
public SyncSignedHttpRequest sign(SyncHttpSignRequest<? extends AwsCredentialsIdentity> request) {
throw new UnsupportedOperationException();
}

@Override
public AsyncSignedHttpRequest signAsync(AsyncHttpSignRequest<? extends AwsCredentialsIdentity> request) {
throw new UnsupportedOperationException();
}
}
4 changes: 2 additions & 2 deletions core/http-auth-aws/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
<artifactId>http-auth-aws</artifactId>
<name>AWS Java SDK :: HTTP Auth AWS</name>
<description>
The AWS SDK for Java - HTTP Auth AWS module contains interfaces and implementations for http authentication
specific to AWS.
The AWS SDK for Java - HTTP Auth AWS module contains interfaces and implementations for HTTP
authentication specific to AWS.
</description>
<url>https://aws.amazon.com/sdkforjava</url>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,23 @@
package software.amazon.awssdk.http.auth.aws;

import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.http.auth.aws.internal.DefaultAwsS3V4HttpSigner;
import software.amazon.awssdk.http.auth.spi.HttpSigner;
import software.amazon.awssdk.identity.spi.AwsCredentialsIdentity;

/**
* An {@link HttpSigner} that will sign a request using an AWS credentials ({@link AwsCredentialsIdentity}),
* specifically for S3.
*/
@SdkPublicApi
public interface AwsS3V4HttpSigner extends HttpSigner {
public interface AwsS3V4HttpSigner extends HttpSigner<AwsCredentialsIdentity> {

/**
* Get a default implementation of a {@link AwsS3V4HttpSigner}
*
* @return AwsS3V4HttpSigner
*/
static AwsS3V4HttpSigner create() {
return new DefaultAwsS3V4HttpSigner();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

package software.amazon.awssdk.http.auth.aws.internal;

import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.http.auth.aws.AwsS3V4HttpSigner;
import software.amazon.awssdk.http.auth.spi.AsyncHttpSignRequest;
import software.amazon.awssdk.http.auth.spi.AsyncSignedHttpRequest;
import software.amazon.awssdk.http.auth.spi.SyncHttpSignRequest;
import software.amazon.awssdk.http.auth.spi.SyncSignedHttpRequest;
import software.amazon.awssdk.identity.spi.AwsCredentialsIdentity;

/**
* A default implementation of {@link AwsS3V4HttpSigner}.
*/
@SdkInternalApi
public class DefaultAwsS3V4HttpSigner implements AwsS3V4HttpSigner {

@Override
public SyncSignedHttpRequest sign(SyncHttpSignRequest<? extends AwsCredentialsIdentity> request) {
throw new UnsupportedOperationException();
}

@Override
public AsyncSignedHttpRequest signAsync(AsyncHttpSignRequest<? extends AwsCredentialsIdentity> request) {
throw new UnsupportedOperationException();
}
}
4 changes: 2 additions & 2 deletions core/http-auth-event-stream/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
<artifactId>http-auth-event-stream</artifactId>
<name>AWS Java SDK :: HTTP Auth Event Stream</name>
<description>
The AWS SDK for Java - HTTP Auth module contains interfaces and implementations for http authentication
specific to the event streams.
The AWS SDK for Java - HTTP Auth Event Stream module contains interfaces and implementations
for authentication of event streams in HTTP services.
</description>
<url>https://aws.amazon.com/sdkforjava</url>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,23 @@
package software.amazon.awssdk.http.auth.eventstream;

import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.http.auth.eventstream.internal.DefaultAwsV4EventStreamHttpSigner;
import software.amazon.awssdk.http.auth.spi.HttpSigner;
import software.amazon.awssdk.identity.spi.AwsCredentialsIdentity;

/**
* An {@link HttpSigner} that will sign a request using an AWS credentials ({@link AwsCredentialsIdentity}),
* specifically for Event Streams.
*/
@SdkPublicApi
public interface AwsV4EventStreamHttpAuthScheme extends HttpSigner {
public interface AwsV4EventStreamHttpSigner extends HttpSigner<AwsCredentialsIdentity> {

/**
* Get a default implementation of a {@link AwsV4EventStreamHttpSigner}
*
* @return AwsV4EventStreamHttpSigner
*/
static AwsV4EventStreamHttpSigner create() {
return new DefaultAwsV4EventStreamHttpSigner();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

package software.amazon.awssdk.http.auth.eventstream.internal;

import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.http.auth.eventstream.AwsV4EventStreamHttpSigner;
import software.amazon.awssdk.http.auth.spi.AsyncHttpSignRequest;
import software.amazon.awssdk.http.auth.spi.AsyncSignedHttpRequest;
import software.amazon.awssdk.http.auth.spi.SyncHttpSignRequest;
import software.amazon.awssdk.http.auth.spi.SyncSignedHttpRequest;
import software.amazon.awssdk.identity.spi.AwsCredentialsIdentity;

/**
* A default implementation of {@link AwsV4EventStreamHttpSigner}.
*/
@SdkInternalApi
public class DefaultAwsV4EventStreamHttpSigner implements AwsV4EventStreamHttpSigner {

@Override
public SyncSignedHttpRequest sign(SyncHttpSignRequest<? extends AwsCredentialsIdentity> request) {
throw new UnsupportedOperationException();
}

@Override
public AsyncSignedHttpRequest signAsync(AsyncHttpSignRequest<? extends AwsCredentialsIdentity> request) {
throw new UnsupportedOperationException();
}
}
19 changes: 18 additions & 1 deletion core/http-auth/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
<artifactId>http-auth</artifactId>
<name>AWS Java SDK :: HTTP Auth</name>
<description>
The AWS SDK for Java - HTTP Auth module contains interfaces and implementations for http authentication
The AWS SDK for Java - HTTP Auth module contains interfaces and implementations
for generic HTTP authentication
</description>
<url>https://aws.amazon.com/sdkforjava</url>

Expand All @@ -43,6 +44,22 @@
<artifactId>http-auth-spi</artifactId>
<version>${awsjavasdk.version}</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>identity-spi</artifactId>
<version>${awsjavasdk.version}</version>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,22 @@
package software.amazon.awssdk.http.auth;

import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.http.auth.internal.DefaultAwsV4HttpSigner;
import software.amazon.awssdk.http.auth.spi.HttpSigner;
import software.amazon.awssdk.identity.spi.AwsCredentialsIdentity;

/**
* An {@link HttpSigner} that will sign a request using an AWS credentials {@link AwsCredentialsIdentity}).
*/
@SdkPublicApi
public interface AwsV4HttpSigner extends HttpSigner {
public interface AwsV4HttpSigner extends HttpSigner<AwsCredentialsIdentity> {

/**
* Get a default implementation of a {@link AwsV4HttpSigner}
*
* @return AwsV4HttpSigner
*/
static AwsV4HttpSigner create() {
return new DefaultAwsV4HttpSigner();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,23 @@
package software.amazon.awssdk.http.auth;

import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.http.auth.internal.DefaultAwsV4QueryHttpSigner;
import software.amazon.awssdk.http.auth.spi.HttpSigner;
import software.amazon.awssdk.identity.spi.AwsCredentialsIdentity;

/**
* An {@link HttpSigner} that will sign a request using an AWS credentials ({@link AwsCredentialsIdentity}),
* specifically for query.
*/
@SdkPublicApi
public interface AwsV4QueryHttpSigner extends HttpSigner {
public interface AwsV4QueryHttpSigner extends HttpSigner<AwsCredentialsIdentity> {

/**
* Get a default implementation of a {@link AwsV4QueryHttpSigner}
*
* @return AwsV4QueryHttpSigner
*/
static AwsV4QueryHttpSigner create() {
return new DefaultAwsV4QueryHttpSigner();
}
}
Loading