Skip to content

Commit 78cd310

Browse files
committed
refactor: drop unused configuration
redirect_uri is set in the old Java client but it's nowhere to be found Python and TS clients. Also tests show that it's not required for exchanging tokens
1 parent 1f73f0f commit 78cd310

3 files changed

Lines changed: 4 additions & 10 deletions

File tree

src/main/java/io/weaviate/client6/v1/internal/oidc/OidcConfig.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55

66
public record OidcConfig(
77
String clientId,
8-
String redirectUrl,
98
String providerMetadata,
109
List<String> scopes) {
1110

12-
public OidcConfig(String clientId, String redirectUrl, String providerMetadata, List<String> scopes) {
11+
public OidcConfig(String clientId, String providerMetadata, List<String> scopes) {
1312
this.clientId = clientId;
14-
this.redirectUrl = redirectUrl;
1513
this.providerMetadata = providerMetadata;
1614
this.scopes = scopes != null ? scopes : Collections.emptyList();
1715
}

src/main/java/io/weaviate/client6/v1/internal/oidc/OidcUtils.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ public final class OidcUtils {
1717
private OidcUtils() {
1818
}
1919

20-
private static final String OPENID_URL = "/.well-known/openid-configuration";
20+
private static final String OPENID_CONFIGURATION_URL = "/.well-known/openid-configuration";
2121

2222
private static final Endpoint<Void, OpenIdConfiguration> GET_OPENID_ENDPOINT = SimpleEndpoint.noBody(
2323
request -> "GET",
24-
request -> "/.well-known/openid-configuration",
24+
request -> OPENID_CONFIGURATION_URL,
2525
request -> Collections.emptyMap(),
2626
OpenIdConfiguration.class);
2727

@@ -53,8 +53,6 @@ public static final OidcConfig getConfig(RestTransport transport) {
5353
} catch (IOException e) {
5454
throw new WeaviateOAuthException("fetch provider metadata", e);
5555
}
56-
57-
var redirectUrl = transport.getTransportOptions().baseUrl() + OPENID_URL;
58-
return new OidcConfig(openid.clientId(), redirectUrl, providerMetadata, openid.scopes());
56+
return new OidcConfig(openid.clientId(), providerMetadata, openid.scopes());
5957
}
6058
}

src/main/java/io/weaviate/client6/v1/internal/oidc/nimbus/NimbusTokenProvider.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public final class NimbusTokenProvider implements TokenProvider {
2323
private final OIDCProviderMetadata metadata;
2424
private final ClientID clientId;
2525
private final Scope scope;
26-
private final String redirectUrl;
2726
private final Flow flow;
2827

2928
/**
@@ -79,7 +78,6 @@ private NimbusTokenProvider(OidcConfig oidc, Flow flow) {
7978

8079
this.clientId = new ClientID(oidc.clientId());
8180
this.scope = new Scope(oidc.scopes().toArray(String[]::new));
82-
this.redirectUrl = oidc.redirectUrl();
8381
this.flow = flow;
8482
}
8583

0 commit comments

Comments
 (0)