Skip to content

Commit

Permalink
issue#431 add logout (logicalclocks#559)
Browse files Browse the repository at this point in the history
  • Loading branch information
ErmiasG authored Feb 10, 2021
1 parent cf4fee0 commit 8a6ddca
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 3 deletions.
3 changes: 3 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,12 @@
# OAuth2
default['oauth']['enabled'] = "false"
default['oauth']['redirect_uri'] = "hopsworks/callback"
default['oauth']['logout_redirect_uri'] = "hopsworks/"
default['oauth']['account_status'] = 1
default['oauth']['group_mapping'] = ""

default['remote_auth']['need_consent'] = "true"

default['hopsworks']['disable_password_login'] = "false"
default['hopsworks']['disable_registration'] = "false"

Expand Down
2 changes: 2 additions & 0 deletions files/default/sql/ddl/2.2.0__initial_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,8 @@ CREATE TABLE `oauth_client` (
`authorisation_endpoint` varchar(1024) COLLATE latin1_general_cs DEFAULT NULL,
`token_endpoint` varchar(1024) COLLATE latin1_general_cs DEFAULT NULL,
`userinfo_endpoint` varchar(1024) COLLATE latin1_general_cs DEFAULT NULL,
`end_session_endpoint` VARCHAR(1024) COLLATE latin1_general_cs DEFAULT NULL,
`logout_redirect_param` VARCHAR(45) COLLATE latin1_general_cs DEFAULT NULL,
`jwks_uri` varchar(1024) COLLATE latin1_general_cs DEFAULT NULL,
`provider_metadata_endpoint_supported` tinyint(1) NOT NULL DEFAULT '0',
`offline_access` tinyint(1) NOT NULL DEFAULT '0',
Expand Down
5 changes: 4 additions & 1 deletion files/default/sql/ddl/updates/2.2.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,7 @@ CREATE TABLE IF NOT EXISTS `feature_group_validation` (
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;

ALTER TABLE `hopsworks`.`feature_group` ADD COLUMN `validation_type` INT(11) DEFAULT '4' AFTER `corr_method`;
ALTER TABLE `hopsworks`.`feature_group_commit` ADD COLUMN `validation_id` int(11), ADD CONSTRAINT `fgc_fk_fgv` FOREIGN KEY (`validation_id`) REFERENCES `feature_group_validation` (`id`) ON DELETE SET NULL ON UPDATE NO ACTION;
ALTER TABLE `hopsworks`.`feature_group_commit` ADD COLUMN `validation_id` int(11), ADD CONSTRAINT `fgc_fk_fgv` FOREIGN KEY (`validation_id`) REFERENCES `feature_group_validation` (`id`) ON DELETE SET NULL ON UPDATE NO ACTION;
ALTER TABLE `hopsworks`.`oauth_client`
ADD COLUMN `end_session_endpoint` VARCHAR(1024) DEFAULT NULL,
ADD COLUMN `logout_redirect_param` VARCHAR(45) DEFAULT NULL;
6 changes: 5 additions & 1 deletion files/default/sql/ddl/updates/undo/2.2.0__undo.sql
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,8 @@ DROP TABLE IF EXISTS `validation_rule`;
DROP TABLE IF EXISTS `feature_group_rule`;
DROP TABLE IF EXISTS `feature_group_validation`;
DROP TABLE IF EXISTS `feature_store_expectation_rule`;
ALTER TABLE `hopsworks`.`feature_group` DROP COLUMN `validation_type`;
ALTER TABLE `hopsworks`.`feature_group` DROP COLUMN `validation_type`;

ALTER TABLE `hopsworks`.`oauth_client`
DROP COLUMN `end_session_endpoint`,
DROP COLUMN `logout_redirect_param`;
7 changes: 7 additions & 0 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -768,13 +768,20 @@
attribute "oauth/redirect_uri",
:description => "OAuth redirect uri. 'hopsworks/callback' (default)",
:type => 'string'
attribute "oauth/logout_redirect_uri",
:description => "OAuth logout redirect uri. 'hopsworks/' (default)",
:type => 'string'
attribute "oauth/account_status",
:description => "Hopsworks account status given for new OAuth user. '1' verified account (default)",
:type => 'string'
attribute "oauth/group_mapping",
:description => "OAuth group to hopsworks group mappings. Format: (groupA-> HOPS_USER,HOPS_ADMIN;groupB->HOPS_USER)",
:type => 'string'

attribute "remote_auth/need_consent",
:description => "Remote user need to consent on first login. 'true' (default)",
:type => 'string'

attribute "hopsworks/disable_password_login",
:description => "Disable password login. 'false' (default)",
:type => 'string'
Expand Down
5 changes: 4 additions & 1 deletion templates/default/sql/dml/2.2.0.sql.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ REPLACE INTO `hopsworks`.`validation_rule` (name, predicate, value_type, descrip
REPLACE INTO `hopsworks`.`validation_rule` (name, predicate, value_type, description) VALUES ("IS_GREATER_THAN_OR_EQUAL_TO", "LEGAL_VALUES", "Fractional", "");
REPLACE INTO `hopsworks`.`validation_rule` (name, predicate, value_type, description) VALUES ("IS_CONTAINED_IN", "LEGAL_VALUES", "String", "");

DELETE FROM `hopsworks`.`variables` WHERE `id` = 'hops_verification_version';
DELETE FROM `hopsworks`.`variables` WHERE `id` = 'hops_verification_version';

REPLACE INTO `hopsworks`.`variables`(`id`, `value`) VALUES ("remote_auth_need_consent", "<%= node['remote_auth']['need_consent'] %>");
REPLACE INTO `hopsworks`.`variables`(`id`, `value`) VALUES ("oauth_logout_redirect_uri", "<%= node['oauth']['logout_redirect_uri'] %>");
3 changes: 3 additions & 0 deletions templates/default/sql/dml/undo/2.2.0__undo.sql.erb
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
DELETE FROM `hopsworks`.`variables` WHERE `id`='yarn_default_payment_type';

DELETE FROM `hopsworks`.`variables` WHERE `id`='remote_auth_need_consent';
DELETE FROM `hopsworks`.`variables` WHERE `id`='oauth_logout_redirect_uri';

0 comments on commit 8a6ddca

Please sign in to comment.