diff --git a/compose/docker-compose.yml b/compose/docker-compose.yml index ea4666d..a5f17d7 100644 --- a/compose/docker-compose.yml +++ b/compose/docker-compose.yml @@ -58,12 +58,14 @@ services: keycloak: image: quay.io/keycloak/keycloak:17.0.0 command: [ - "start --hostname-strict=false --https-key-store-file=/etc/keycloak-keystore.jks" +# "start --hostname-strict=false --https-key-store-file=/etc/keycloak-keystore.jks" + "start-dev --hostname-strict=false" ] ports: - - "8543:8443" + - "8180:8080" +# - "8543:8443" environment: KEYCLOAK_ADMIN: "admin" KEYCLOAK_ADMIN_PASSWORD: "admin" - volumes: - - ./config/keycloak-keystore.jks:/etc/keycloak-keystore.jks +# volumes: +# - ./config/keycloak-keystore.jks:/etc/keycloak-keystore.jks diff --git a/src/main/java/org/commonjava/indy/service/repository/data/cassandra/CassandraStoreDataManager.java b/src/main/java/org/commonjava/indy/service/repository/data/cassandra/CassandraStoreDataManager.java index 6092ce1..368278a 100644 --- a/src/main/java/org/commonjava/indy/service/repository/data/cassandra/CassandraStoreDataManager.java +++ b/src/main/java/org/commonjava/indy/service/repository/data/cassandra/CassandraStoreDataManager.java @@ -23,7 +23,6 @@ import org.commonjava.indy.service.repository.data.annotations.ClusterStoreDataManager; import org.commonjava.indy.service.repository.data.infinispan.CacheHandle; import org.commonjava.indy.service.repository.data.infinispan.CacheProducer; -import org.commonjava.indy.service.repository.exception.IndyDataException; import org.commonjava.indy.service.repository.model.AbstractRepository; import org.commonjava.indy.service.repository.model.ArtifactStore; import org.commonjava.indy.service.repository.model.Group; @@ -82,6 +81,7 @@ public class CassandraStoreDataManager private final Integer STORE_EXPIRATION_IN_MINS = 15; + @SuppressWarnings( "unused" ) protected CassandraStoreDataManager() { } @@ -116,7 +116,7 @@ protected Optional getArtifactStoreInternal( StoreKey key ) } } - return Optional.ofNullable( computeIfAbsent( ARTIFACT_STORE, key, STORE_EXPIRATION_IN_MINS, Boolean.FALSE ) ); + return Optional.ofNullable( computeIfAbsent( key, STORE_EXPIRATION_IN_MINS, Boolean.FALSE ) ); } @Override @@ -230,7 +230,7 @@ protected ArtifactStore putArtifactStoreInternal( StoreKey storeKey, ArtifactSto DtxArtifactStore dtxArtifactStore = toDtxArtifactStore( storeKey, store ); storeQuery.createDtxArtifactStore( dtxArtifactStore ); - return computeIfAbsent( ARTIFACT_STORE, storeKey, STORE_EXPIRATION_IN_MINS, Boolean.TRUE ); + return computeIfAbsent( storeKey, STORE_EXPIRATION_IN_MINS, Boolean.TRUE ); } @Override @@ -635,11 +635,11 @@ public void initRemoteStoresCache() .forEach( s -> remoteKojiStores.put( s.getKey(), s ) ); } - private ArtifactStore computeIfAbsent( String name, StoreKey key, int expirationMins, boolean forceQuery ) + private ArtifactStore computeIfAbsent( StoreKey key, int expirationMins, boolean forceQuery ) { - logger.debug( "computeIfAbsent, cache: {}, key: {}", name, key ); + logger.debug( "computeIfAbsent, cache: {}, key: {}", ARTIFACT_STORE, key ); - CacheHandle cache = cacheProducer.getCache( name ); + CacheHandle cache = cacheProducer.getCache( ARTIFACT_STORE ); ArtifactStore store = cache.get( key ); if ( store == null || forceQuery ) { @@ -662,7 +662,7 @@ private ArtifactStore computeIfAbsent( String name, StoreKey key, int expiration } } - logger.trace( "Return value, cache: {}, key: {}, ret: {}", name, key, store ); + logger.trace( "Return value, cache: {}, key: {}, ret: {}", ARTIFACT_STORE, key, store ); return store; } diff --git a/src/main/java/org/commonjava/indy/service/repository/jaxrs/version/StatsHandler.java b/src/main/java/org/commonjava/indy/service/repository/jaxrs/version/StatsHandler.java index 26fc703..44c1fac 100644 --- a/src/main/java/org/commonjava/indy/service/repository/jaxrs/version/StatsHandler.java +++ b/src/main/java/org/commonjava/indy/service/repository/jaxrs/version/StatsHandler.java @@ -95,7 +95,7 @@ public Response getPackageTypeMap() @APIResponse( responseCode = "200", content = @Content( schema = @Schema( implementation = Set.class ), example = "[\"generic-http\",\"maven\",\"npm\"]" ), description = "The package type listing" ) - @Path( "/responseCode-type/keys" ) + @Path( "/package-type/keys" ) @GET @Produces( APPLICATION_JSON ) public Response getPackageTypeNames() diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 5ac5d7e..9fd0d31 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -76,7 +76,7 @@ quarkus: always-include: true indy_security: - enabled: True + enabled: False repository: data-storage: mem diff --git a/src/main/resources/security-bindings.yaml b/src/main/resources/security-bindings.yaml deleted file mode 100644 index de81c9b..0000000 --- a/src/main/resources/security-bindings.yaml +++ /dev/null @@ -1,35 +0,0 @@ -# -# Copyright (C) 2011-2022 Red Hat, Inc. (https://github.com/Commonjava/indy-repository-service) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -constraints: - - role: admin - urlPattern: "/api/admin/.*" - methods: - - POST - - PUT - - DELETE - - role: user - urlPattern: "/api/.*" - methods: - - POST - - PUT - - DELETE - - role: power-user - urlPattern: "/api/admin/stores/.*" - methods: - - POST - - PUT - - DELETE diff --git a/src/test/java/org/commonjava/indy/service/repository/jaxrs/StatsHandlerTest.java b/src/test/java/org/commonjava/indy/service/repository/jaxrs/StatsHandlerTest.java index 459c504..8301f92 100644 --- a/src/test/java/org/commonjava/indy/service/repository/jaxrs/StatsHandlerTest.java +++ b/src/test/java/org/commonjava/indy/service/repository/jaxrs/StatsHandlerTest.java @@ -39,7 +39,7 @@ public void testGetAppVersion() @Test public void testGetPackageTypeNames() { - given().get( "/api/stats/responseCode-type/keys" ) + given().get( "/api/stats/package-type/keys" ) .then() .statusCode( OK.getStatusCode() ) .body( containsString( "maven" ) );