-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: optional expiration lower bound param; expand JWT auth endpo…
…ints (#18) * update (docs): adding expiration lower bound param in paths via query params or request body * update (migrations): add expiration_lower_bound column * update (data): handle ExpirationLowerBound field during insert * update (helpers): move selector params in separate structure, use BirthDateFormat as general DateFormat for params, add expiration lower bound handling to build selector and set proof params * update (service): to use refactored helpers package, handle expiration lower bound for verification links and proof params * fix: expiration lower bound default value during Inserting new VerifyUser instance; move default timestamp value in constant * update: Auth middleware to store claims in ctx for future check in endpoints * feature: add authentication for sensitive endpoints * fix: make auth service optional using Enabled config field, set it disabled by default, handle disabled client in helpers authenticates method * fix: build event data in the same way as smart contract does * fix: use user id keccak256 hash in event data * add: extra logs to debug * fix: ExtractEventData without prepending * feature: implement upsert to update params for users with the same user id * add: helper function to check default ZK date * update: use Upsert instead of Get/Insert approach, use helper default zk date for clear code * update: auth version * fix: var-naming linter error
- Loading branch information
Showing
23 changed files
with
333 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,4 +33,5 @@ poseidonsmt_root_verifier: | |
request_timeout: 10s | ||
|
||
auth: | ||
enabled: false | ||
addr: http://rarime-auth |
10 changes: 10 additions & 0 deletions
10
docs/spec/components/parameters/expirationLowerBoundParam.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
in: query | ||
name: 'expiration_lower_bound' | ||
required: false | ||
description: | | ||
Param to enable or disable passport expiration lower bound check.\n | ||
- Empty value or `false` - default date is used (52983525027888) | ||
- `true` - encoded current UTC timestamp is used | ||
example: true | ||
schema: | ||
type: boolean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
-- +migrate Up | ||
ALTER TABLE verify_users ADD COLUMN expiration_lower_bound TEXT NOT NULL DEFAULT '0x303030303030'; | ||
-- +migrate Down | ||
ALTER TABLE verify_users DROP COLUMN expiration_lower_bound; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.