-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(common/service)!: add authorization for using secrets
Signed-off-by: Sebastian Becker <[email protected]>
- Loading branch information
Showing
8 changed files
with
179 additions
and
79 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
amphora-common/src/main/java/io/carbynestack/amphora/common/rest/UseRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Copyright (c) 2024 - for information on the respective copyright owner | ||
* see the NOTICE file and/or the repository https://github.com/carbynestack/amphora. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.carbynestack.amphora.common.rest; | ||
|
||
import lombok.NonNull; | ||
import lombok.Value; | ||
|
||
@Value | ||
public class UseRequest { | ||
@NonNull | ||
String programId; | ||
} |
24 changes: 24 additions & 0 deletions
24
amphora-common/src/test/java/io/carbynestack/amphora/common/rest/UseRequestTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright (c) 2024 - for information on the respective copyright owner | ||
* see the NOTICE file and/or the repository https://github.com/carbynestack/amphora. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.carbynestack.amphora.common.rest; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.fasterxml.jackson.databind.exc.ValueInstantiationException; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
class UseRequestTest { | ||
|
||
@Test | ||
void givenNoProgramIdProvided_whenParseJson_thenThrowException() { | ||
assertThrows(ValueInstantiationException.class, () -> | ||
new ObjectMapper().readValue("{}", UseRequest.class)); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.