Skip to content

Commit

Permalink
Add access_grant_timelock, not_usable_before and not_usable_after int…
Browse files Browse the repository at this point in the history
…o consumed_write_grants
  • Loading branch information
sapience committed Feb 5, 2025
1 parent de79ea8 commit 3ec5a97
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions schema.development.kf
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,13 @@ table write_grants {

table consumed_write_grants {
id uuid primary,
wg_owner_wallet_identifier text notnull, // user wallet/pk
wg_grantee_wallet_identifier text notnull, // issuer wallet/pk
owner_wallet_identifier text notnull, // user wallet/pk
grantee_wallet_identifier text notnull, // issuer wallet/pk
original_credential_id uuid,
copy_credential_id uuid,
access_grant_timelock text,
not_usable_before text,
not_usable_after text,
foreign_key (original_credential_id) references credentials(id) on_delete set null,
foreign_key (copy_credential_id) references credentials(id) on_delete set null
}
Expand Down Expand Up @@ -722,11 +725,23 @@ action create_credentials_by_dwg(

INSERT INTO consumed_write_grants (
id,
wg_owner_wallet_identifier,
wg_grantee_wallet_identifier,
owner_wallet_identifier,
grantee_wallet_identifier,
original_credential_id,
copy_credential_id
) VALUES ($dwg_id, $dwg_owner, @caller, $original_credential_id, $copy_credential_id);
copy_credential_id,
access_grant_timelock,
not_usable_before,
not_usable_after
) VALUES (
$dwg_id,
$dwg_owner,
$dwg_grantee,
$original_credential_id,
$copy_credential_id,
$dwg_access_grant_timelock,
$dwg_not_before,
$dwg_not_after
);
}

@kgw(authn='true')
Expand Down

0 comments on commit 3ec5a97

Please sign in to comment.