1 /* 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"). 5 * You may not use this file except in compliance with the License. 6 * A copy of the License is located at 7 * 8 * http://aws.amazon.com/apache2.0 9 * 10 * or in the "license" file accompanying this file. This file is distributed 11 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 * express or implied. See the License for the specific language governing 13 * permissions and limitations under the License. 14 */ 15 16 package software.amazon.awssdk.http.auth.scheme; 17 18 import software.amazon.awssdk.annotations.SdkPublicApi; 19 import software.amazon.awssdk.http.auth.internal.scheme.DefaultNoAuthAuthScheme; 20 import software.amazon.awssdk.http.auth.spi.scheme.AuthScheme; 21 import software.amazon.awssdk.http.auth.spi.signer.HttpSigner; 22 import software.amazon.awssdk.identity.spi.Identity; 23 import software.amazon.awssdk.identity.spi.IdentityProvider; 24 import software.amazon.awssdk.identity.spi.IdentityProviders; 25 26 /** 27 * An auth scheme that represents no authentication. 28 */ 29 @SdkPublicApi 30 public interface NoAuthAuthScheme extends AuthScheme<NoAuthAuthScheme.AnonymousIdentity> { 31 /** 32 * The scheme ID for the no-auth auth scheme. 33 */ 34 String SCHEME_ID = "smithy.api#noAuth"; 35 create()36 static NoAuthAuthScheme create() { 37 return DefaultNoAuthAuthScheme.create(); 38 } 39 40 /** 41 * Retrieve the {@link AnonymousIdentity} based {@link IdentityProvider} associated with this authentication scheme. 42 */ 43 @Override identityProvider(IdentityProviders providers)44 IdentityProvider<AnonymousIdentity> identityProvider(IdentityProviders providers); 45 46 /** 47 * Retrieve the {@link HttpSigner} associated with this authentication scheme. 48 */ 49 @Override signer()50 HttpSigner<AnonymousIdentity> signer(); 51 52 /** 53 * An anonymous identity used by the no-auth auth scheme. 54 */ 55 interface AnonymousIdentity extends Identity { 56 } 57 } 58