Skip to content

Commit

Permalink
Add relocate interceptor for each fallback interceptor
Browse files Browse the repository at this point in the history
  • Loading branch information
gsmet committed Mar 11, 2024
1 parent ef4b798 commit 5a7141a
Show file tree
Hide file tree
Showing 14 changed files with 189 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package io.quarkus.oidc.client.filter.runtime;

import io.smallrye.config.RelocateConfigSourceInterceptor;

/**
* @deprecated maps the old config to the new config, should be removed at some point
*/
@Deprecated(forRemoval = true, since = "3.9")
public class OidcClientFilterConfigRelocateInterceptor extends RelocateConfigSourceInterceptor {

private static final String OLD_PREFIX = "quarkus.oidc-client-filter.";
private static final String NEW_PREFIX = "quarkus.resteasy-client-oidc-filter.";

public OidcClientFilterConfigRelocateInterceptor() {
super(OidcClientFilterConfigRelocateInterceptor::rename);
}

private static String rename(String originalName) {
if (!originalName.startsWith(OLD_PREFIX)) {
return originalName;
}

return originalName.replaceFirst(OLD_PREFIX, NEW_PREFIX);
}
}
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
io.quarkus.oidc.client.filter.runtime.OidcClientFilterConfigFallbackInterceptor
io.quarkus.oidc.client.filter.runtime.OidcClientFilterConfigFallbackInterceptor
io.quarkus.oidc.client.filter.runtime.OidcClientFilterConfigRelocateInterceptor
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package io.quarkus.oidc.client.reactive.filter.runtime;

import io.smallrye.config.RelocateConfigSourceInterceptor;

/**
* @deprecated maps the old config to the new config, should be removed at some point
*/
@Deprecated(forRemoval = true, since = "3.9")
public class OidcClientReactiveFilterConfigRelocateInterceptor extends RelocateConfigSourceInterceptor {

private static final String OLD_PREFIX = "quarkus.oidc-client-reactive-filter.";
private static final String NEW_PREFIX = "quarkus.rest-client-oidc-filter.";

public OidcClientReactiveFilterConfigRelocateInterceptor() {
super(OidcClientReactiveFilterConfigRelocateInterceptor::rename);
}

private static String rename(String originalName) {
if (!originalName.startsWith(OLD_PREFIX)) {
return originalName;
}

return originalName.replaceFirst(OLD_PREFIX, NEW_PREFIX);
}
}
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
io.quarkus.oidc.client.reactive.filter.runtime.OidcClientReactiveFilterConfigFallbackInterceptor
io.quarkus.oidc.client.reactive.filter.runtime.OidcClientReactiveFilterConfigFallbackInterceptor
io.quarkus.oidc.client.reactive.filter.runtime.OidcClientReactiveFilterConfigRelocateInterceptor
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package io.quarkus.oidc.token.propagation.reactive;

import io.smallrye.config.RelocateConfigSourceInterceptor;

/**
* @deprecated maps the old config to the new config, should be removed at some point
*/
@Deprecated(forRemoval = true, since = "3.9")
public class OidcTokenPropagationReactiveConfigRelocateInterceptor extends RelocateConfigSourceInterceptor {

private static final String OLD_PREFIX = "quarkus.oidc-token-propagation.";
private static final String NEW_PREFIX = "quarkus.rest-client-oidc-token-propagation.";

public OidcTokenPropagationReactiveConfigRelocateInterceptor() {
super(OidcTokenPropagationReactiveConfigRelocateInterceptor::rename);
}

private static String rename(String originalName) {
if (!originalName.startsWith(OLD_PREFIX)) {
return originalName;
}

return originalName.replaceFirst(OLD_PREFIX, NEW_PREFIX);
}
}
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
io.quarkus.oidc.token.propagation.reactive.OidcTokenPropagationReactiveConfigFallbackInterceptor
io.quarkus.oidc.token.propagation.reactive.OidcTokenPropagationReactiveConfigFallbackInterceptor
io.quarkus.oidc.token.propagation.reactive.OidcTokenPropagationReactiveConfigRelocateInterceptor
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package io.quarkus.oidc.token.propagation.runtime;

import io.smallrye.config.RelocateConfigSourceInterceptor;

/**
* @deprecated maps the old config to the new config, should be removed at some point
*/
@Deprecated(forRemoval = true, since = "3.9")
public class OidcTokenPropagationConfigRelocateInterceptor extends RelocateConfigSourceInterceptor {

private static final String OLD_PREFIX = "quarkus.oidc-token-propagation.";
private static final String NEW_PREFIX = "quarkus.resteasy-client-oidc-token-propagation.";

public OidcTokenPropagationConfigRelocateInterceptor() {
super(OidcTokenPropagationConfigRelocateInterceptor::rename);
}

private static String rename(String originalName) {
if (!originalName.startsWith(OLD_PREFIX)) {
return originalName;
}

return originalName.replaceFirst(OLD_PREFIX, NEW_PREFIX);
}
}
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
io.quarkus.oidc.token.propagation.runtime.OidcTokenPropagationConfigFallbackInterceptor
io.quarkus.oidc.token.propagation.runtime.OidcTokenPropagationConfigFallbackInterceptor
io.quarkus.oidc.token.propagation.runtime.OidcTokenPropagationConfigRelocateInterceptor
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package io.quarkus.rest.client.reactive.runtime;

import io.smallrye.config.RelocateConfigSourceInterceptor;

/**
* @deprecated maps the old config to the new config, should be removed at some point
*/
@Deprecated(forRemoval = true, since = "3.9")
public class RestClientReactiveConfigRelocateInterceptor extends RelocateConfigSourceInterceptor {

private static final String OLD_PREFIX = "quarkus.rest-client-reactive.";
private static final String NEW_PREFIX = "quarkus.rest-client.";

public RestClientReactiveConfigRelocateInterceptor() {
super(RestClientReactiveConfigRelocateInterceptor::rename);
}

private static String rename(String originalName) {
if (!originalName.startsWith(OLD_PREFIX)) {
return originalName;
}

return originalName.replaceFirst(OLD_PREFIX, NEW_PREFIX);
}
}
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
io.quarkus.rest.client.reactive.runtime.RestClientReactiveConfigFallbackInterceptor
io.quarkus.rest.client.reactive.runtime.RestClientReactiveConfigFallbackInterceptor
io.quarkus.rest.client.reactive.runtime.RestClientReactiveConfigRelocateInterceptor
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package io.quarkus.resteasy.reactive.common.runtime;

import io.smallrye.config.RelocateConfigSourceInterceptor;

/**
* @deprecated maps the old config to the new config, should be removed at some point
*/
@Deprecated(forRemoval = true, since = "3.9")
public class ResteasyReactiveConfigRelocateInterceptor extends RelocateConfigSourceInterceptor {

private static final String OLD_PREFIX = "quarkus.resteasy-reactive.";
private static final String NEW_PREFIX = "quarkus.rest.";

public ResteasyReactiveConfigRelocateInterceptor() {
super(ResteasyReactiveConfigRelocateInterceptor::rename);
}

private static String rename(String originalName) {
if (!originalName.startsWith(OLD_PREFIX)) {
return originalName;
}

return originalName.replaceFirst(OLD_PREFIX, NEW_PREFIX);
}
}
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
io.quarkus.resteasy.reactive.common.runtime.ResteasyReactiveConfigFallbackInterceptor
io.quarkus.resteasy.reactive.common.runtime.ResteasyReactiveConfigFallbackInterceptor
io.quarkus.resteasy.reactive.common.runtime.ResteasyReactiveConfigRelocateInterceptor
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package io.quarkus.csrf.reactive.runtime;

import io.smallrye.config.RelocateConfigSourceInterceptor;

/**
* @deprecated maps the old config to the new config, should be removed at some point
*/
@Deprecated(forRemoval = true, since = "3.9")
public class CsrfReactiveConfigRelocateInterceptor extends RelocateConfigSourceInterceptor {

private static final String OLD_PREFIX = "quarkus.csrf-reactive.";
private static final String NEW_PREFIX = "quarkus.rest-csrf.";

public CsrfReactiveConfigRelocateInterceptor() {
super(CsrfReactiveConfigRelocateInterceptor::rename);
}

private static String rename(String originalName) {
if (!originalName.startsWith(OLD_PREFIX)) {
return originalName;
}

return originalName.replaceFirst(OLD_PREFIX, NEW_PREFIX);
}
}
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
io.quarkus.csrf.reactive.runtime.CsrfReactiveConfigFallbackInterceptor
io.quarkus.csrf.reactive.runtime.CsrfReactiveConfigFallbackInterceptor
io.quarkus.csrf.reactive.runtime.CsrfReactiveConfigRelocateInterceptor

0 comments on commit 5a7141a

Please sign in to comment.