diff options
author | zotlabs <mike@macgirvin.com> | 2018-04-03 21:08:40 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2018-04-03 21:08:40 -0700 |
commit | 4915a4efbb5a25668a917a953b8d8c49a3181e1c (patch) | |
tree | c78dc0df6e224f5f4030267061704de5c140bfef /install | |
parent | 245142cc07bd989adfb03bb7680e3db948e7564f (diff) | |
download | volse-hubzilla-4915a4efbb5a25668a917a953b8d8c49a3181e1c.tar.gz volse-hubzilla-4915a4efbb5a25668a917a953b8d8c49a3181e1c.tar.bz2 volse-hubzilla-4915a4efbb5a25668a917a953b8d8c49a3181e1c.zip |
OAuth2 integration
Diffstat (limited to 'install')
-rw-r--r-- | install/schema_mysql.sql | 52 | ||||
-rw-r--r-- | install/schema_postgres.sql | 54 |
2 files changed, 106 insertions, 0 deletions
diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index 0d098d661..bfb49d195 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -1597,3 +1597,55 @@ CREATE TABLE if not exists calendarinstances ( UNIQUE(calendarid, principaluri), UNIQUE(calendarid, share_href) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + + +CREATE TABLE if not exists oauth_clients ( + client_id VARCHAR(80) NOT NULL, + client_secret VARCHAR(80), + redirect_uri VARCHAR(2000), + grant_types VARCHAR(80), + scope VARCHAR(4000), + user_id VARCHAR(80), + PRIMARY KEY (client_id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE if not exists oauth_access_tokens ( + access_token VARCHAR(40) NOT NULL, + client_id VARCHAR(80) NOT NULL, + user_id VARCHAR(255), + expires TIMESTAMP NOT NULL, + scope VARCHAR(4000), + PRIMARY KEY (access_token) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE if not exists oauth_authorization_codes ( + authorization_code VARCHAR(40) NOT NULL, + client_id VARCHAR(80) NOT NULL, + user_id VARCHAR(255), + redirect_uri VARCHAR(2000), + expires TIMESTAMP NOT NULL, + scope VARCHAR(4000), + id_token VARCHAR(1000), + PRIMARY KEY (authorization_code) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE if not exists oauth_refresh_tokens ( + refresh_token VARCHAR(40) NOT NULL, + client_id VARCHAR(80) NOT NULL, + user_id VARCHAR(255), + expires TIMESTAMP NOT NULL, + scope VARCHAR(4000), + PRIMARY KEY (refresh_token) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE if not exists oauth_scopes ( + scope VARCHAR(191) NOT NULL, + is_default TINYINT(1), + PRIMARY KEY (scope) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE if not exists oauth_jwt ( + client_id VARCHAR(80) NOT NULL, + subject VARCHAR(80), + public_key VARCHAR(2000) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index a4f6e9253..df94712fe 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -1610,3 +1610,57 @@ ALTER TABLE ONLY users CREATE UNIQUE INDEX users_ukey ON users USING btree (username); + + +CREATE TABLE oauth_clients ( + client_id VARCHAR(80) NOT NULL, + client_secret VARCHAR(80), + redirect_uri VARCHAR(2000), + grant_types VARCHAR(80), + scope VARCHAR(4000), + user_id VARCHAR(80), + PRIMARY KEY (client_id) +); + +CREATE TABLE oauth_access_tokens ( + access_token VARCHAR(40) NOT NULL, + client_id VARCHAR(80) NOT NULL, + user_id VARCHAR(255), + expires TIMESTAMP NOT NULL, + scope VARCHAR(4000), + PRIMARY KEY (access_token) +); + +CREATE TABLE oauth_authorization_codes ( + authorization_code VARCHAR(40) NOT NULL, + client_id VARCHAR(80) NOT NULL, + user_id VARCHAR(255), + redirect_uri VARCHAR(2000), + expires TIMESTAMP NOT NULL, + scope VARCHAR(4000), + id_token VARCHAR(1000), + PRIMARY KEY (authorization_code) +); + +CREATE TABLE oauth_refresh_tokens ( + refresh_token VARCHAR(40) NOT NULL, + client_id VARCHAR(80) NOT NULL, + user_id VARCHAR(255), + expires TIMESTAMP NOT NULL, + scope VARCHAR(4000), + PRIMARY KEY (refresh_token) +); + +CREATE TABLE oauth_scopes ( + scope VARCHAR(191) NOT NULL, + is_default SMALLINT, + PRIMARY KEY (scope) +); + +CREATE TABLE oauth_jwt ( + client_id VARCHAR(80) NOT NULL, + subject VARCHAR(80), + public_key VARCHAR(2000) NOT NULL +); + + |