-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/device_auth_grant' of https://github.com/pedrule/h…
…ydra into feat/device_auth_grant
- Loading branch information
Showing
16 changed files
with
192 additions
and
10 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
persistence/sql/migrations/20220728111500000000_device_authorization_flow.sqlite.down.sql
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,3 @@ | ||
DROP TABLE IF EXISTS hydra_oauth2_device_link_request; | ||
DROP TABLE IF EXISTS hydra_oauth2_device_code; | ||
DROP TABLE IF EXISTS hydra_oauth2_user_code; |
69 changes: 69 additions & 0 deletions
69
persistence/sql/migrations/20220728111500000000_device_authorization_flow.sqlite.up.sql
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,69 @@ | ||
CREATE TABLE IF NOT EXISTS hydra_oauth2_device_link_request | ||
( | ||
challenge VARCHAR(40) NOT NULL PRIMARY KEY, | ||
verifier VARCHAR(40) NOT NULL, | ||
client_id VARCHAR(255) NOT NULL REFERENCES hydra_client (id) ON DELETE CASCADE, | ||
request_url TEXT NOT NULL, | ||
requested_scope TEXT NOT NULL, | ||
device_code VARCHAR(255) NOT NULL, | ||
csrf VARCHAR(40) NOT NULL, | ||
requested_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
oidc_context TEXT NOT NULL, | ||
login_challenge VARCHAR(40) NULL REFERENCES hydra_oauth2_authentication_request (challenge) ON DELETE SET NULL, | ||
requested_at_audience TEXT NOT NULL DEFAULT '', | ||
UNIQUE (challenge) | ||
); | ||
|
||
CREATE INDEX hydra_oauth2_device_link_request_client_id_idx ON hydra_oauth2_consent_request (client_id); | ||
CREATE INDEX hydra_oauth2_device_link_request_subject_idx ON hydra_oauth2_consent_request (subject); | ||
CREATE INDEX hydra_oauth2_device_link_request_login_session_id_idx ON hydra_oauth2_consent_request (login_session_id); | ||
CREATE INDEX hydra_oauth2_device_link_request_login_challenge_idx ON hydra_oauth2_consent_request (login_challenge); | ||
|
||
--- | ||
CREATE TABLE IF NOT EXISTS hydra_oauth2_device_code | ||
( | ||
signature VARCHAR(255) NOT NULL PRIMARY KEY, | ||
request_id VARCHAR(40) NOT NULL, | ||
requested_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
client_id VARCHAR(255) NOT NULL REFERENCES hydra_client (id) ON DELETE CASCADE, | ||
scope TEXT NOT NULL, | ||
granted_scope TEXT NOT NULL, | ||
form_data TEXT NOT NULL, | ||
session_data TEXT NOT NULL, | ||
subject VARCHAR(255) NOT NULL DEFAULT '', | ||
active INTEGER NOT NULL DEFAULT true, | ||
requested_audience TEXT NULL DEFAULT '', | ||
granted_audience TEXT NULL DEFAULT '', | ||
challenge_id VARCHAR(40) NULL REFERENCES hydra_oauth2_consent_request (challenge) ON DELETE CASCADE, | ||
UNIQUE (request_id) | ||
); | ||
|
||
CREATE INDEX hydra_oauth2_device_code_requested_at_idx ON hydra_oauth2_device_code (requested_at); | ||
CREATE INDEX hydra_oauth2_device_code_client_id_idx ON hydra_oauth2_device_code (client_id); | ||
CREATE INDEX hydra_oauth2_device_code_challenge_id_idx ON hydra_oauth2_device_code (challenge_id); | ||
CREATE INDEX hydra_oauth2_device_code_client_id_subject_idx ON hydra_oauth2_device_code (client_id, subject); | ||
|
||
--- | ||
|
||
CREATE TABLE IF NOT EXISTS hydra_oauth2_user_code | ||
( | ||
signature VARCHAR(255) NOT NULL PRIMARY KEY, | ||
request_id VARCHAR(40) NOT NULL, | ||
requested_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
client_id VARCHAR(255) NOT NULL REFERENCES hydra_client (id) ON DELETE CASCADE, | ||
scope TEXT NOT NULL, | ||
granted_scope TEXT NOT NULL, | ||
form_data TEXT NOT NULL, | ||
session_data TEXT NOT NULL, | ||
subject VARCHAR(255) NOT NULL DEFAULT '', | ||
active INTEGER NOT NULL DEFAULT true, | ||
requested_audience TEXT NULL DEFAULT '', | ||
granted_audience TEXT NULL DEFAULT '', | ||
challenge_id VARCHAR(40) NULL REFERENCES hydra_oauth2_device_link_request (challenge) ON DELETE CASCADE, | ||
UNIQUE (request_id) | ||
); | ||
|
||
CREATE INDEX hydra_oauth2_user_code_requested_at_idx ON hydra_oauth2_user_code (requested_at); | ||
CREATE INDEX hydra_oauth2_user_code_client_id_idx ON hydra_oauth2_user_code (client_id); | ||
CREATE INDEX hydra_oauth2_user_code_challenge_id_idx ON hydra_oauth2_user_code (challenge_id); | ||
CREATE INDEX hydra_oauth2_user_code_client_id_subject_idx ON hydra_oauth2_user_code (client_id, subject); |
File renamed without changes.
File renamed without changes.
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