diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-08-15 10:11:17 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-08-15 10:11:17 +0200 |
commit | 3d7de36cdd35fbfe95ba20c30b37cd81249b076b (patch) | |
tree | e466ac66b7ad9d388ff4c1e72d28e8372c68cb3c /src/stasis/stasis-0001.sql | |
parent | 6f0432ed839d1f5a7a1e880f492ce162073b680b (diff) | |
download | anastasis-3d7de36cdd35fbfe95ba20c30b37cd81249b076b.tar.gz anastasis-3d7de36cdd35fbfe95ba20c30b37cd81249b076b.tar.bz2 anastasis-3d7de36cdd35fbfe95ba20c30b37cd81249b076b.zip |
expand database plugin with logic to store wire transfer data made for authentication
Diffstat (limited to 'src/stasis/stasis-0001.sql')
-rw-r--r-- | src/stasis/stasis-0001.sql | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/stasis/stasis-0001.sql b/src/stasis/stasis-0001.sql index 87dde94..e0ebfa6 100644 --- a/src/stasis/stasis-0001.sql +++ b/src/stasis/stasis-0001.sql @@ -193,5 +193,34 @@ COMMENT ON INDEX anastasis_challengecode_expiration_index IS 'for challenge garbage collection'; +CREATE TABLE IF NOT EXISTS anastasis_auth_iban_in + (auth_in_serial_id BIGSERIAL UNIQUE + ,wire_reference INT8 NOT NULL PRIMARY KEY + ,wire_subject TEXT NOT NULL + ,credit_val INT8 NOT NULL + ,credit_frac INT4 NOT NULL + ,debit_account_details TEXT NOT NULL + ,credit_account_details TEXT NOT NULL + ,execution_date INT8 NOT NULL + ); +COMMENT ON TABLE anastasis_auth_iban_in + IS 'list of IBAN wire transfers for authentication using the IBAN plugin'; +COMMENT ON COLUMN anastasis_auth_iban_in.wire_reference + IS 'Unique number identifying the wire transfer in LibEuFin/Nexus'; +COMMENT ON COLUMN anastasis_auth_iban_in.wire_subject + IS 'For authentication, this contains the code, but also additional text'; +COMMENT ON COLUMN anastasis_auth_iban_in.execution_date + IS 'Used both for (theoretical) garbage collection and to see if the transfer happened on time'; +COMMENT ON COLUMN anastasis_auth_iban_in.credit_account_details + IS 'Identifies the bank account of the Anastasis provider, which could change over time'; +COMMENT ON COLUMN anastasis_auth_iban_in.debit_account_details + IS 'Identifies the bank account of the customer, which must match what was given in the truth'; + +CREATE INDEX IF NOT EXISTS anastasis_auth_iban_in_lookup_index + ON anastasis_auth_iban_in + (debit_account_details + ,execution_date + ); + -- Complete transaction COMMIT; |