-
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.
- fetch jwk from keycloak (depending on config) - validate JWTs issued by keycloak based on JWKs - verify resource roles from keycloak - implement basic stats api using keycloak authorization
- Loading branch information
1 parent
94d566d
commit 148534c
Showing
19 changed files
with
648 additions
and
31 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
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,46 @@ | ||
-- Make members number unique | ||
ALTER TABLE members ADD UNIQUE (member_number); | ||
|
||
-- Add rejceted at column to registration requests | ||
ALTER TABLE registration_requests | ||
ADD COLUMN rejected_at TIMESTAMPTZ; | ||
|
||
COMMENT ON COLUMN registration_requests.rejected_at IS 'Time when request was rejected. If NULL then it was never rejected'; | ||
|
||
-- Create views | ||
|
||
CREATE OR REPLACE VIEW registration_requests_unverified AS | ||
SELECT * FROM registration_requests rr | ||
WHERE rr.confirmed_at IS NULL | ||
AND rr.rejected_at IS NULL | ||
AND NOT EXISTS (SELECT id FROM members m WHERE rr.id = m.registration_request_id); | ||
|
||
COMMENT ON VIEW registration_requests_unverified IS 'All registration requests which are waiting on email confirmation'; | ||
|
||
GRANT SELECT ON registration_requests_unverified TO orca; | ||
|
||
CREATE OR REPLACE VIEW registration_requests_accepted AS | ||
SELECT * FROM registration_requests rr | ||
WHERE EXISTS (SELECT id FROM members m WHERE rr.id = m.registration_request_id); | ||
|
||
COMMENT ON VIEW registration_requests_accepted IS 'All registration requests that were accepted (as members)'; | ||
|
||
GRANT SELECT ON registration_requests_accepted TO orca; | ||
|
||
CREATE OR REPLACE VIEW registration_requests_rejected AS | ||
SELECT * FROM registration_requests rr | ||
WHERE rr.rejected_at IS NOT NULL; | ||
|
||
COMMENT ON VIEW registration_requests_rejected IS 'All registration requests that were rejected'; | ||
|
||
GRANT SELECT ON registration_requests_rejected TO orca; | ||
|
||
CREATE OR REPLACE VIEW registration_requests_procession AS | ||
SELECT * FROM registration_requests rr | ||
WHERE rr.confirmed_at IS NOT NULL | ||
AND rr.rejected_at IS NULL | ||
AND NOT EXISTS (SELECT id FROM members m WHERE rr.id = m.registration_request_id); | ||
|
||
COMMENT ON VIEW registration_requests_procession IS 'All registrations which are confirmed by applicant but are not yet either rejected or accepted'; | ||
|
||
GRANT SELECT ON registration_requests_procession TO orca; |
Oops, something went wrong.