Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
49a609a
feat: add KeyCommand and KeyEvents
coplat Dec 12, 2025
57cfce7
feat: setsigningkey
coplat Dec 12, 2025
6e5e4a8
refactor: KeyCommand, KeyError, KeyEvent
coplat Dec 15, 2025
c2ac670
refactor: KeyEvent
coplat Dec 15, 2025
0ad277b
feat: add `v1` and identity api endpoints
coplat Dec 16, 2025
2aad836
refactor: remove comments
coplat Dec 16, 2025
1095970
refactor: remove key commands
coplat Dec 17, 2025
d024617
refactor: SigningAlgorithm in mod.rs
coplat Dec 17, 2025
5d3caac
Merge remote-tracking branch 'origin/feat/verification-method' into f…
coplat Dec 17, 2025
8afed62
refactor: update key api endpoints with saga
coplat Dec 17, 2025
391fc23
refactor: update key api endpoints with saga
coplat Dec 17, 2025
2eb12d5
refactor comment
coplat Dec 17, 2025
b704d2a
feat: update postman collection
coplat Dec 18, 2025
ecfdbb8
Merge branch 'feat/keys-api' of https://github.com/impierce/ssi-agent…
coplat Dec 18, 2025
713fc73
docs: add `v0/keys/` to openapi.yaml
coplat Dec 18, 2025
5737bdc
refactor: list_all endpoint
coplat Dec 19, 2025
5699e83
fix: saga commands in endpoint
coplat Dec 29, 2025
62f6991
feat: return managed_key_id from key_generation_saga
coplat Dec 29, 2025
74caf52
fix: managed_key_id helper function, prevent unwrap panic
coplat Dec 30, 2025
adb7499
Merge branch 'feat/verification-method' of https://github.com/impierc…
coplat Dec 30, 2025
1fd7e66
nit: rephrase
coplat Dec 30, 2025
c6d1415
nit: `PostRenameAlias` to `PostRenameKeyAlias`
coplat Dec 30, 2025
c61e9a1
docs: add `list-all` path to openapi
coplat Dec 30, 2025
a5f9dfa
nit: comments
coplat Dec 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

105 changes: 105 additions & 0 deletions agent_api_http/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1396,6 +1396,111 @@ paths:
"201":
description: Linked VP service created successfully

/v0/keys/generate-new-key:
post:
tags:
- Identity
summary: Generate a new key
description: Generates a new cryptographic key and stores it in the key management system.
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- alias
properties:
alias:
type: string
description: A human-readable name for this key.
example: "my-signing-key-01"
signatureAlgorithm:
type: string
description: The signature algorithm to use for this key. Defaults to Ed25519 if not specified.
example: "Ed25519"

/v0/keys/remove-key:
post:
tags:
- Identity
summary: Remove an existing key
description: Removes an existing cryptographic key from the key management system.
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- keyId
properties:
keyId:
type: string
description: The ID of the key to remove.
example: "a81bc81b-d7a7-4e5d-abff-90865d1e13b1"

/v0/keys/rename-key-alias:
post:
tags:
- Identity
summary: Rename the alias of a key
description: Renames the human-readable alias of an existing cryptographic key in the key management system.
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- keyId
- newAlias
properties:
keyId:
type: string
description: The ID of the key to rename.
example: "a81bc81b-d7a7-4e5d-abff-90865d1e13b1"
newAlias:
type: string
description: The new alias for the key.
example: "my-new-key-alias"

/v0/keys/set-signing-key:
post:
tags:
- Identity
summary: Set a key as the active signing key
description: Designates a specific managed key to be used for signing operations.
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- keyId
properties:
keyId:
type: string
description: The ID of the key to set as the signing key.
example: "a81bc81b-abcd-4e5d-abff-90865d1e13b1"

/v0/keys/list-all:
get:
tags:
- Identity
summary: List all managed keys
description: Retrieves a list of all cryptographic keys managed by the key management system.
responses:
"200":
description: Keys retrieved successfully
content:
application/json:
schema:
type: array
items:
type: object

/auth/token:
post:
summary: Standard OAuth 2.0 endpoint for fetching a token
Expand Down
151 changes: 149 additions & 2 deletions agent_api_http/postman/ssi-agent.postman_collection.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"info": {
"_postman_id": "e9b3fbae-f20e-4957-9d3a-6a310f5fda62",
"_postman_id": "4da8f32a-5645-4785-911d-5c2c729e2092",
"name": "ssi-agent",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "38461474"
"_exporter_id": "41786572",
"_collection_link": "https://impierce-technologies-bv.postman.co/workspace/New-Team-Workspace~1aa38760-77fc-4608-a1f5-e8a6fdaa0ad9/collection/41786572-4da8f32a-5645-4785-911d-5c2c729e2092?action=share&source=collection_link&creator=41786572"
},
"item": [
{
Expand Down Expand Up @@ -2281,6 +2282,152 @@
"response": []
}
]
},
{
"name": "v1",
"item": [
{
"name": "Identity",
"item": [
{
"name": "Keys",
"item": [
{
"name": "Generate Key",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"alias\": \"An Example Alias\",\n \"signingAlgorithm\": \"ES256\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{HOST}}/v0/keys/generate-new-key",
"host": [
"{{HOST}}"
],
"path": [
"v0",
"keys",
"generate-new-key"
]
}
},
"response": []
},
{
"name": "Remove Key",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"keyId\": \"your-managed-key-id\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{HOST}}/v0/keys/remove-key",
"host": [
"{{HOST}}"
],
"path": [
"v0",
"keys",
"remove-key"
]
}
},
"response": []
},
{
"name": "Rename Key Alias",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"keyId\": \"your-managed-key-id\",\n \"newAlias\": \"new-key-alias\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{HOST}}/v0/keys/rename-key-alias",
"host": [
"{{HOST}}"
],
"path": [
"v0",
"keys",
"rename-key-alias"
]
}
},
"response": []
},
{
"name": "Set Signing Key",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"keyId\": \"your-managed-key-id\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{HOST}}/v0/keys/set-signing-key",
"host": [
"{{HOST}}"
],
"path": [
"v0",
"keys",
"set-signing-key"
]
}
},
"response": []
},
{
"name": "List all Keys",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{HOST}}/v0/keys/list-all",
"host": [
"{{HOST}}"
],
"path": [
"v0",
"keys",
"list-all"
]
}
},
"response": []
}
]
}
]
}
]
}
],
"auth": {
Expand Down
19 changes: 16 additions & 3 deletions agent_api_http/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
pub mod v0;
pub mod v1;

pub mod error;
pub mod handlers;
pub mod metrics;
pub mod utils;

use crate::v1::identity::IdentityContext;
use agent_authorization::state::AuthorizationState;
use agent_holder::state::HolderState;
use agent_identity::{
Expand Down Expand Up @@ -55,13 +57,24 @@ pub fn app(
issuance_state,
holder_state,
verification_state,

key_generation_saga: _,
key_removal_saga: _,
key_generation_saga,
key_removal_saga,
}: ApplicationState,
) -> Router {
let v1_identity_router = match (identity_state.clone(), key_generation_saga, key_removal_saga) {
(Some(state), Some(gen_saga), Some(rem_saga)) => {
let context = IdentityContext {
state,
key_generation_saga: gen_saga,
key_removal_saga: rem_saga,
};
v1::identity::router(context)
}
_ => Router::new(),
};
let app = Router::new()
.merge(identity_state.map(v0::identity::router).unwrap_or_default())
.merge(v1_identity_router)
.merge(library_state.map(v0::library::router).unwrap_or_default())
.merge(
authorization_state
Expand Down
9 changes: 4 additions & 5 deletions agent_api_http/src/v0/identity/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ pub mod well_known;

pub mod error;

use crate::{
v0::identity::profiles::{get_profile, patch_profile},
API_VERSION,
};
use agent_identity::state::IdentityState;
use axum::{
routing::{get, post},
Expand All @@ -18,11 +22,6 @@ use services::{linked_vp::linked_vp, service, services};
use std::sync::Arc;
use well_known::{did::did, did_configuration::did_configuration};

use crate::{
v0::identity::profiles::{get_profile, patch_profile},
API_VERSION,
};

pub fn router(identity_state: Arc<IdentityState>) -> Router {
Router::new()
.nest(
Expand Down
Loading
Loading