Skip to content

Commit e172d91

Browse files
authored
feat(athena): Handle auth token in api/gateway/v1/rbac/registration GET (#687)
* handle auth token in rbac-reg get endpoint Signed-off-by: bkioshn <bkioshn@gmail.com> * update dep Signed-off-by: bkioshn <bkioshn@gmail.com> --------- Signed-off-by: bkioshn <bkioshn@gmail.com>
1 parent 8edb492 commit e172d91

File tree

7 files changed

+445
-56
lines changed

7 files changed

+445
-56
lines changed

hermes/apps/athena/Cargo.lock

Lines changed: 52 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

hermes/apps/athena/modules/rbac-registration/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,13 @@ ed25519-dalek = "2.2.0"
2525
chrono = "0.4.42"
2626
regex = "1.12.2"
2727
uuid = { version = "1.18.1", features = ["v4", "v7", "serde"] }
28+
base64 = "0.22.1"
2829

2930
cardano-blockchain-types = { version = "0.0.8", git = "https://github.com/input-output-hk/catalyst-libs", tag = "cardano-blockchain-types/v0.0.8" }
3031
rbac-registration = { version = "0.0.14", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "rbac-registration/v0.0.14" }
3132
catalyst-types = { version = "0.0.10", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "catalyst-types/v0.0.10" }
3233
c509-certificate = { version = "0.0.3", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "c509-certificate-v0.0.3" }
34+
35+
[dev-dependencies]
36+
test-case = "3.3.1"
37+
rand = "0.8.5"

hermes/apps/athena/modules/rbac-registration/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ impl exports::hermes::init::event::Guest for RbacRegistrationComponent {
7777
impl exports::hermes::http_gateway::event::Guest for RbacRegistrationComponent {
7878
fn reply(
7979
_body: Vec<u8>,
80-
_headers: Headers,
80+
headers: Headers,
8181
path: String,
8282
_method: String,
8383
) -> Option<HttpGatewayResponse> {
8484
log::init(log::LevelFilter::Info);
8585

8686
let network = cardano::api::CardanoNetwork::Preprod;
8787
let lookup = parse_query_param(&path, "lookup");
88-
let result = endpoint_v1(lookup, network);
88+
let result = endpoint_v1(lookup, network, &headers);
8989
let code = result.status_code();
9090

9191
Some(HttpGatewayResponse::Http(HttpResponse {

hermes/apps/athena/modules/rbac-registration/src/rbac/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ pub(crate) mod build_rbac_chain;
44
pub(crate) mod get_rbac;
55
pub(crate) mod rbac_chain_metadata;
66
pub(crate) mod registration_location;
7+
pub(crate) mod token;

0 commit comments

Comments
 (0)