Skip to content

Commit beea01b

Browse files
touilleManMax-7
authored andcommitted
Fix OpenBao route pattern used to sign/verify with a given OpenBao entity
1 parent 10bb59c commit beea01b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

libparsec/crates/openbao/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl OpenBaoCmds {
8888
}
8989

9090
/// This signing system relies on the fact OpenBao is configured to only
91-
/// allow POST `/transit/sign/user-{entity_id}` (i.e. the signing API) to
91+
/// allow POST `/transit/sign/entity-{entity_id}` (i.e. the signing API) to
9292
/// the user referenced in OpenBao by this entity ID.
9393
///
9494
/// This way the verify operation knows the entity ID of the author, and can

libparsec/crates/openbao/src/sign.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ enum SignOutcome {
1313
}
1414

1515
fn generate_sign_key_name(openbao_entity_id: &str) -> String {
16-
format!("user-{}", openbao_entity_id)
16+
format!("entity-{}", openbao_entity_id)
1717
}
1818

1919
pub async fn sign(cmds: &OpenBaoCmds, payload: &[u8]) -> Result<String, OpenBaoSignError> {

server/parsec/cli/testbed.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ async def test_openbao_create_key(request: Request, key_name: str):
530530
if not entity_id:
531531
return Response(status_code=403)
532532

533-
if key_name != f"user-{entity_id}":
533+
if key_name != f"entity-{entity_id}":
534534
return Response(status_code=403)
535535

536536
# See https://openbao.org/api-docs/secret/transit/#create-key
@@ -592,7 +592,7 @@ async def test_openbao_sign(request: Request, key_name: str):
592592
if not entity_id:
593593
return Response(status_code=403)
594594

595-
if key_name != f"user-{entity_id}":
595+
if key_name != f"entity-{entity_id}":
596596
return Response(status_code=403)
597597

598598
# See https://openbao.org/api-docs/secret/transit/#sign-data
@@ -640,7 +640,7 @@ async def test_openbao_verify(request: Request, key_name: str):
640640
if not entity_id:
641641
return Response(status_code=403)
642642

643-
author_entity_id = key_name.removeprefix("user-")
643+
author_entity_id = key_name.removeprefix("entity-")
644644

645645
# See https://openbao.org/api-docs/secret/transit/#verify-signed-data
646646

0 commit comments

Comments
 (0)