Skip to content
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

chore: Use ServiceIdentifier Constants from the Service Binding Library #367

Merged
merged 9 commits into from
Sep 10, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,9 @@ class BtpServicePropertySuppliers
static final OAuth2PropertySupplierResolver CONNECTIVITY =
OAuth2PropertySupplierResolver.forServiceIdentifier(ServiceIdentifier.CONNECTIVITY, ConnectivityProxy::new);

/**
* {@link ServiceIdentifier#IDENTITY_AUTHENTICATION} referenced indirectly for backwards compatibility.
*/
static final OAuth2PropertySupplierResolver IDENTITY_AUTHENTICATION =
OAuth2PropertySupplierResolver
.forServiceIdentifier(ServiceIdentifier.of("identity"), IdentityAuthentication::new);
.forServiceIdentifier(ServiceIdentifier.IDENTITY_AUTHENTICATION, IdentityAuthentication::new);

static final OAuth2PropertySupplierResolver WORKFLOW =
OAuth2PropertySupplierResolver
Expand Down Expand Up @@ -79,7 +76,7 @@ class BtpServicePropertySuppliers
.withUrlKey(BusinessLoggingOptions.WRITE_API, "writeservice", REMOVE_PATH)
.factory());
static final OAuth2PropertySupplierResolver AI_CORE =
OAuth2PropertySupplierResolver.forServiceIdentifier(ServiceIdentifier.of("aicore"), AiCore::new);
OAuth2PropertySupplierResolver.forServiceIdentifier(ServiceIdentifier.AI_CORE, AiCore::new);

private static final List<OAuth2PropertySupplierResolver> DEFAULT_SERVICE_RESOLVERS = new ArrayList<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public Try<HttpDestination> tryGetDestination( @Nonnull final ServiceBindingDest

final ServiceBindingDestinationOptions.Builder optionsBuilder;
try {
optionsBuilder = ServiceBindingDestinationOptions.forService(ServiceIdentifier.of("identity"));
optionsBuilder = ServiceBindingDestinationOptions.forService(ServiceIdentifier.IDENTITY_AUTHENTICATION);
}
catch( final DestinationAccessException e ) {
return Try.failure(new DestinationAccessException(preparedMessage, e));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,6 @@ static class Builder
private static final String XSUAA_TOKEN_PATH = "/oauth/token";
private static final Duration DEFAULT_TIME_OUT = Duration.ofSeconds(10);

/**
* {@link ServiceIdentifier#IDENTITY_AUTHENTICATION} referenced indirectly for backwards compatibility.
*/
private static final ServiceIdentifier IDENTITY_AUTHENTICATION = ServiceIdentifier.of("identity");

private URI tokenUri;
private ClientIdentity identity;
private OnBehalfOf onBehalfOf = OnBehalfOf.TECHNICAL_USER_CURRENT_TENANT;
Expand Down Expand Up @@ -358,7 +353,7 @@ Builder withTenantPropagationStrategy( @Nonnull final TenantPropagationStrategy
Builder withTenantPropagationStrategyFrom( @Nullable final ServiceIdentifier serviceIdentifier )
{
final TenantPropagationStrategy tenantPropagationStrategy;
if( IDENTITY_AUTHENTICATION.equals(serviceIdentifier) ) {
if( ServiceIdentifier.IDENTITY_AUTHENTICATION.equals(serviceIdentifier) ) {
tenantPropagationStrategy = TenantPropagationStrategy.TENANT_SUBDOMAIN;
} else {
tenantPropagationStrategy = TenantPropagationStrategy.ZID_HEADER;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ class AiCoreTest
{
final ServiceBinding binding =
bindingWithCredentials(
ServiceIdentifier.of("aicore"),
ServiceIdentifier.AI_CORE,
entry("serviceurls.AI_API_URL", "https://api.ai.internalprod.eu-central-1.aws.ml.hana.ondemand.com"),
entry("clientid", "client-id"),
entry("clientsecret", "client-secret"),
Expand Down
Loading