Skip to content

Commit 854d017

Browse files
committed
more
1 parent 06cccdd commit 854d017

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

app/src/main/java/io/apicurio/common/apps/auth/authn/AppAuthenticationMechanism.java

-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ private HttpAuthenticationMechanism selectEnabledAuth() {
155155
@Override
156156
public Uni<SecurityIdentity> authenticate(RoutingContext context, IdentityProviderManager identityProviderManager) {
157157
if (basicAuthEnabled) {
158-
setAuditLogger(context);
159158
return basicAuthenticationMechanism.authenticate(context, identityProviderManager);
160159
} else if (oidcAuthEnabled) {
161160
setAuditLogger(context);

app/src/test/java/io/apicurio/registry/auth/BasicAuthWithPropertiesTest.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import io.apicurio.registry.types.ArtifactType;
99
import io.apicurio.registry.utils.tests.*;
1010
import io.kiota.http.vertx.VertXRequestAdapter;
11+
import io.quarkus.security.AuthenticationFailedException;
1112
import io.quarkus.test.junit.QuarkusTest;
1213
import io.quarkus.test.junit.TestProfile;
1314
import org.junit.jupiter.api.Assertions;
@@ -62,10 +63,9 @@ public void testWrongCreds() throws Exception {
6263
var adapter = new VertXRequestAdapter(buildSimpleAuthWebClient(UUID.randomUUID().toString(), UUID.randomUUID().toString()));
6364
adapter.setBaseUrl(registryV3ApiUrl);
6465
RegistryClient client = new RegistryClient(adapter);
65-
var exception = Assertions.assertThrows(Exception.class, () -> {
66+
Assertions.assertThrows(AuthenticationFailedException.class, () -> {
6667
client.groups().byGroupId(groupId).artifacts().get();
6768
});
68-
assertTrue(exception.getMessage().contains("Unauthorized"));
6969
}
7070

7171
@Test
@@ -253,11 +253,11 @@ public void testGetArtifactOwner() throws Exception {
253253
assertEquals(groupId, created.getGroupId());
254254
assertEquals(artifactId, created.getArtifactId());
255255
assertEquals(version, created.getVersion());
256-
assertEquals("developer-client", created.getOwner());
256+
assertEquals(DEVELOPER_USERNAME, created.getOwner());
257257

258258
//Get the artifact owner via the REST API and verify it
259259
ArtifactMetaData amd = client.groups().byGroupId(groupId).artifacts().byArtifactId(artifactId).get();
260-
assertEquals("developer-client", amd.getOwner());
260+
assertEquals(DEVELOPER_USERNAME, amd.getOwner());
261261
}
262262

263263
@Test
@@ -291,20 +291,20 @@ public void testUpdateArtifactOwner() throws Exception {
291291
assertEquals(groupId, created.getGroupId());
292292
assertEquals(artifactId, created.getArtifactId());
293293
assertEquals(version, created.getVersion());
294-
assertEquals("developer-client", created.getOwner());
294+
assertEquals(DEVELOPER_USERNAME, created.getOwner());
295295

296296
//Get the artifact owner via the REST API and verify it
297297
ArtifactMetaData amd = client.groups().byGroupId(groupId).artifacts().byArtifactId(artifactId).get();
298-
assertEquals("developer-client", amd.getOwner());
298+
assertEquals(DEVELOPER_USERNAME, amd.getOwner());
299299

300300
//Update the owner
301301
EditableArtifactMetaData eamd = new EditableArtifactMetaData();
302-
eamd.setOwner("developer-2-client");
302+
eamd.setOwner(DEVELOPER_2_USERNAME);
303303
client.groups().byGroupId(groupId).artifacts().byArtifactId(artifactId).put(eamd);
304304

305305
//Check that the update worked
306306
amd = client.groups().byGroupId(groupId).artifacts().byArtifactId(artifactId).get();
307-
assertEquals("developer-2-client", amd.getOwner());
307+
assertEquals(DEVELOPER_2_USERNAME, amd.getOwner());
308308
}
309309

310310
@Test

utils/tests/src/main/java/io/apicurio/registry/utils/tests/BasicAuthWithPropertiesTestProfile.java

+1-6
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ public Map<String, String> getConfigOverrides() {
3030

3131
@Override
3232
public List<TestResourceEntry> testResources() {
33-
if (!Boolean.parseBoolean(System.getProperty("cluster.tests"))) {
34-
return List.of(
35-
new TestResourceEntry(JWKSMockServer.class));
36-
} else {
37-
return Collections.emptyList();
38-
}
33+
return Collections.emptyList();
3934
}
4035
}

0 commit comments

Comments
 (0)