mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-08 16:38:04 +00:00
Add localhost:8585 as jwks urls; Fix entity consolidations when there is no previous chnage available (#15001)
This commit is contained in:
parent
25c6260bd7
commit
968f146fe7
@ -2057,22 +2057,24 @@ public abstract class EntityRepository<T extends EntityInterface> {
|
|||||||
// set changeDescription to null
|
// set changeDescription to null
|
||||||
T updatedOld = updated;
|
T updatedOld = updated;
|
||||||
previous = getPreviousVersion(original);
|
previous = getPreviousVersion(original);
|
||||||
LOG.debug(
|
if (previous != null) {
|
||||||
"In session change consolidation. Reverting to previous version {}",
|
LOG.debug(
|
||||||
previous.getVersion());
|
"In session change consolidation. Reverting to previous version {}",
|
||||||
updated = previous;
|
previous.getVersion());
|
||||||
updateInternal();
|
updated = previous;
|
||||||
LOG.info(
|
updateInternal();
|
||||||
"In session change consolidation. Reverting to previous version {} completed",
|
LOG.info(
|
||||||
previous.getVersion());
|
"In session change consolidation. Reverting to previous version {} completed",
|
||||||
|
previous.getVersion());
|
||||||
|
|
||||||
// Now go from original to updated
|
// Now go from original to updated
|
||||||
updated = updatedOld;
|
updated = updatedOld;
|
||||||
updateInternal();
|
updateInternal();
|
||||||
|
|
||||||
// Finally, go from previous to the latest updated entity to consolidate changes
|
// Finally, go from previous to the latest updated entity to consolidate changes
|
||||||
original = previous;
|
original = previous;
|
||||||
entityChanged = false;
|
entityChanged = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Compare original and updated entities and perform updates. Update the entity version and track changes. */
|
/** Compare original and updated entities and perform updates. Update the entity version and track changes. */
|
||||||
|
@ -59,6 +59,11 @@ public class JwtFilter implements ContainerRequestFilter {
|
|||||||
private String principalDomain;
|
private String principalDomain;
|
||||||
private boolean enforcePrincipalDomain;
|
private boolean enforcePrincipalDomain;
|
||||||
private AuthProvider providerType;
|
private AuthProvider providerType;
|
||||||
|
|
||||||
|
private static final List<String> DEFAULT_PUBLIC_KEY_URLS =
|
||||||
|
Arrays.asList(
|
||||||
|
"http://localhost:8585/api/v1/system/config/jwks",
|
||||||
|
"http://host.docker.internal:8585/api/v1/system/config/jwks");
|
||||||
public static final List<String> EXCLUDED_ENDPOINTS =
|
public static final List<String> EXCLUDED_ENDPOINTS =
|
||||||
List.of(
|
List.of(
|
||||||
"v1/system/config/jwks",
|
"v1/system/config/jwks",
|
||||||
@ -89,6 +94,13 @@ public class JwtFilter implements ContainerRequestFilter {
|
|||||||
for (String publicKeyUrlStr : authenticationConfiguration.getPublicKeyUrls()) {
|
for (String publicKeyUrlStr : authenticationConfiguration.getPublicKeyUrls()) {
|
||||||
publicKeyUrlsBuilder.add(new URL(publicKeyUrlStr));
|
publicKeyUrlsBuilder.add(new URL(publicKeyUrlStr));
|
||||||
}
|
}
|
||||||
|
// avoid users misconfiguration and add default publicKeyUrls
|
||||||
|
for (String publicKeyUrl : DEFAULT_PUBLIC_KEY_URLS) {
|
||||||
|
if (!authenticationConfiguration.getPublicKeyUrls().contains(publicKeyUrl)) {
|
||||||
|
publicKeyUrlsBuilder.add(new URL(publicKeyUrl));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.jwkProvider = new MultiUrlJwkProvider(publicKeyUrlsBuilder.build());
|
this.jwkProvider = new MultiUrlJwkProvider(publicKeyUrlsBuilder.build());
|
||||||
this.principalDomain = authorizerConfiguration.getPrincipalDomain();
|
this.principalDomain = authorizerConfiguration.getPrincipalDomain();
|
||||||
this.enforcePrincipalDomain = authorizerConfiguration.getEnforcePrincipalDomain();
|
this.enforcePrincipalDomain = authorizerConfiguration.getEnforcePrincipalDomain();
|
||||||
|
@ -32,7 +32,9 @@ final class MultiUrlJwkProvider implements JwkProvider {
|
|||||||
public Jwk get(String keyId) throws JwkException {
|
public Jwk get(String keyId) throws JwkException {
|
||||||
JwkException lastException =
|
JwkException lastException =
|
||||||
new SigningKeyNotFoundException(
|
new SigningKeyNotFoundException(
|
||||||
"JWT Token keyID doesn't match the configured keyID.", null);
|
"JWT Token keyID doesn't match the configured keyID. This usually happens if you didn't configure "
|
||||||
|
+ "proper publicKeyUrls under authentication configuration.",
|
||||||
|
null);
|
||||||
for (UrlJwkProvider jwkProvider : urlJwkProviders) {
|
for (UrlJwkProvider jwkProvider : urlJwkProviders) {
|
||||||
try {
|
try {
|
||||||
return jwkProvider.get(keyId);
|
return jwkProvider.get(keyId);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user