Skip to content

feat(amphora-service): protect public endpoints

Codacy Production / Codacy Static Code Analysis required action Nov 14, 2024 in 0s

5 new issues (0 max.) of at least minor severity.

Codacy Here is an overview of what got changed by this pull request:

Issues
======
+ Solved 1
- Added 5
           

Complexity increasing per file
==============================
- amphora-service/src/main/java/io/carbynestack/amphora/service/opa/OpaClientRequest.java  5
- amphora-service/src/main/java/io/carbynestack/amphora/service/opa/OpaClient.java  2
- amphora-service/src/test/java/io/carbynestack/amphora/service/opa/OpaClientTest.java  2
- amphora-service/src/main/java/io/carbynestack/amphora/service/opa/OpaService.java  1
- amphora-service/src/main/java/io/carbynestack/amphora/service/opa/OpaRequest.java  1
- amphora-service/src/main/java/io/carbynestack/amphora/service/exceptions/CsOpaException.java  1
- amphora-service/src/main/java/io/carbynestack/amphora/service/exceptions/UnauthorizedException.java  1
- amphora-service/src/main/java/io/carbynestack/amphora/service/opa/JwtReader.java  3
- amphora-service/src/main/java/io/carbynestack/amphora/service/opa/OpaRequestBody.java  1
- amphora-service/src/main/java/io/carbynestack/amphora/service/opa/OpaResult.java  1
- amphora-service/src/test/java/io/carbynestack/amphora/service/opa/JwtReaderTest.java  1
- amphora-service/src/main/java/io/carbynestack/amphora/service/config/OpaConfig.java  1
- amphora-service/src/test/java/io/carbynestack/amphora/service/opa/OpaServiceTest.java  1
         

Clones removed
==============
+ amphora-service/src/test/java/io/carbynestack/amphora/service/persistence/metadata/StorageServiceTest.java  -2
         

See the complete overview on Codacy

Annotations

Check warning on line 60 in amphora-service/src/main/java/io/carbynestack/amphora/service/opa/JwtReader.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

amphora-service/src/main/java/io/carbynestack/amphora/service/opa/JwtReader.java#L60

Avoid reassigning parameters such as 'node'

Check notice on line 62 in amphora-service/src/test/java/io/carbynestack/amphora/service/persistence/metadata/StorageServiceTest.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

amphora-service/src/test/java/io/carbynestack/amphora/service/persistence/metadata/StorageServiceTest.java#L62

Unnecessary use of fully qualified name 'Collections.singletonList' due to existing static import 'java.util.Collections.*'

Check warning on line 467 in amphora-service/src/test/java/io/carbynestack/amphora/service/persistence/metadata/StorageServiceTest.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

amphora-service/src/test/java/io/carbynestack/amphora/service/persistence/metadata/StorageServiceTest.java#L467

Avoid unused local variables such as 'newTag'.

Check notice on line 761 in amphora-service/src/test/java/io/carbynestack/amphora/service/persistence/metadata/StorageServiceTest.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

amphora-service/src/test/java/io/carbynestack/amphora/service/persistence/metadata/StorageServiceTest.java#L761

Unnecessary use of fully qualified name 'Collections.singleton' due to existing static import 'java.util.Collections.*'

Check warning on line 72 in amphora-service/src/test/java/io/carbynestack/amphora/service/rest/TagsControllerTest.java

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

amphora-service/src/test/java/io/carbynestack/amphora/service/rest/TagsControllerTest.java#L72

JUnit tests should include assert() or fail()