2023-02-23 13:24:43 +00:00
|
|
|
// peer_identity is a cache for storagenode certificates.
|
2023-01-06 16:27:42 +00:00
|
|
|
model peer_identity (
|
|
|
|
key node_id
|
|
|
|
|
2023-02-23 13:24:43 +00:00
|
|
|
// node_id refers to storj.NodeID.
|
2023-01-06 16:27:42 +00:00
|
|
|
field node_id blob
|
2023-02-23 13:24:43 +00:00
|
|
|
// leaf_serial_number is the certificate serial number.
|
2023-01-06 16:27:42 +00:00
|
|
|
field leaf_serial_number blob (updatable)
|
2023-02-23 13:24:43 +00:00
|
|
|
// chain is the x509 certificate as ASN.1 DER.
|
|
|
|
field chain blob (updatable)
|
|
|
|
// updated_at is the time it was last updated.
|
2023-01-06 16:27:42 +00:00
|
|
|
field updated_at timestamp ( autoinsert, autoupdate )
|
|
|
|
)
|
|
|
|
|
|
|
|
create peer_identity ( noreturn )
|
|
|
|
update peer_identity (
|
|
|
|
where peer_identity.node_id = ?
|
|
|
|
noreturn
|
|
|
|
)
|
|
|
|
|
|
|
|
read one (
|
|
|
|
select peer_identity
|
|
|
|
where peer_identity.node_id = ?
|
|
|
|
)
|
|
|
|
read one (
|
|
|
|
select peer_identity.leaf_serial_number
|
|
|
|
where peer_identity.node_id = ?
|
|
|
|
)
|
|
|
|
|
|
|
|
model revocation (
|
|
|
|
key revoked
|
|
|
|
field revoked blob
|
|
|
|
field api_key_id blob
|
|
|
|
)
|
|
|
|
|
|
|
|
create revocation ( noreturn )
|