- If enabled, users can submit Dockerfiles to be built and pushed by the Enterprise Registry.
+ If enabled, users can submit Dockerfiles to be built and pushed by .
diff --git a/static/js/core-config-setup.js b/static/js/core-config-setup.js
index bc208ef5a..c025870c2 100644
--- a/static/js/core-config-setup.js
+++ b/static/js/core-config-setup.js
@@ -41,6 +41,10 @@ angular.module("core-config-setup", ['angularFileUpload'])
return config.AUTHENTICATION_TYPE == 'Keystone';
}, 'password': true},
+ {'id': 'oidc-auth', 'title': 'OIDC Authentication', 'condition': function(config) {
+ return config.AUTHENTICATION_TYPE == 'OIDC';
+ }},
+
{'id': 'signer', 'title': 'ACI Signing', 'condition': function(config) {
return config.FEATURE_ACI_CONVERSION;
}},
@@ -201,7 +205,7 @@ angular.module("core-config-setup", ['angularFileUpload'])
return null;
}
- return key.substr(0, index);
+ return key.substr(0, index).toLowerCase();
};
$scope.getOIDCProviders = function(config) {
@@ -685,6 +689,12 @@ angular.module("core-config-setup", ['angularFileUpload'])
$scope.configform.$setValidity('storageConfig', valid);
};
+ $scope.$watch('config.INTERNAL_OIDC_SERVICE_ID', function(service_id) {
+ if (service_id) {
+ $scope.config['FEATURE_DIRECT_LOGIN'] = false;
+ }
+ });
+
$scope.$watch('config.FEATURE_STORAGE_REPLICATION', function() {
refreshStorageConfig();
});
diff --git a/util/config/validator.py b/util/config/validator.py
index dda3bd666..90582ccd1 100644
--- a/util/config/validator.py
+++ b/util/config/validator.py
@@ -22,6 +22,7 @@ from util.config.validators.validate_oidc import OIDCLoginValidator
from util.config.validators.validate_timemachine import TimeMachineValidator
from util.config.validators.validate_access import AccessSettingsValidator
from util.config.validators.validate_actionlog_archiving import ActionLogArchivingValidator
+from util.config.validators.validate_oidcauth import OIDCAuthValidator
logger = logging.getLogger(__name__)
@@ -59,6 +60,7 @@ VALIDATORS = {
TimeMachineValidator.name: TimeMachineValidator.validate,
AccessSettingsValidator.name: AccessSettingsValidator.validate,
ActionLogArchivingValidator.name: ActionLogArchivingValidator.validate,
+ OIDCAuthValidator.name: OIDCAuthValidator.validate,
}
def validate_service_for_config(service, config, password=None):
diff --git a/util/config/validators/test/test_validate_oidcauth.py b/util/config/validators/test/test_validate_oidcauth.py
new file mode 100644
index 000000000..7c5609ccb
--- /dev/null
+++ b/util/config/validators/test/test_validate_oidcauth.py
@@ -0,0 +1,32 @@
+import pytest
+
+from util.config.validators import ConfigValidationException
+from util.config.validators.validate_oidcauth import OIDCAuthValidator
+
+from test.fixtures import *
+
+@pytest.mark.parametrize('unvalidated_config', [
+ ({'AUTHENTICATION_TYPE': 'OIDC'}),
+ ({'AUTHENTICATION_TYPE': 'OIDC', 'INTERNAL_OIDC_SERVICE_ID': 'someservice'}),
+])
+def test_validate_invalid_oidc_auth_config(unvalidated_config, app):
+ validator = OIDCAuthValidator()
+
+ with pytest.raises(ConfigValidationException):
+ validator.validate(unvalidated_config, None, None)
+
+
+def test_validate_oidc_auth(app):
+ config = {
+ 'AUTHENTICATION_TYPE': 'OIDC',
+ 'INTERNAL_OIDC_SERVICE_ID': 'someservice',
+ 'SOMESERVICE_LOGIN_CONFIG': {
+ 'CLIENT_ID': 'foo',
+ 'CLIENT_SECRET': 'bar',
+ 'OIDC_SERVER': 'http://someserver',
+ },
+ 'HTTPCLIENT': None,
+ }
+
+ validator = OIDCAuthValidator()
+ validator.validate(config, None, None)
diff --git a/util/config/validators/validate_oidcauth.py b/util/config/validators/validate_oidcauth.py
new file mode 100644
index 000000000..bfec66ed7
--- /dev/null
+++ b/util/config/validators/validate_oidcauth.py
@@ -0,0 +1,23 @@
+from app import app
+from data.users.oidc import OIDCInternalAuth, UnknownServiceException
+from util.config.validators import BaseValidator, ConfigValidationException
+
+class OIDCAuthValidator(BaseValidator):
+ name = "oidc-auth"
+
+ @classmethod
+ def validate(cls, config, user, user_password):
+ if config.get('AUTHENTICATION_TYPE', 'Database') != 'OIDC':
+ return
+
+ login_service_id = config.get('INTERNAL_OIDC_SERVICE_ID')
+ if not login_service_id:
+ raise ConfigValidationException('Missing OIDC provider')
+
+ # By instantiating the auth engine, it will check if the provider exists and works.
+ try:
+ OIDCInternalAuth(config, login_service_id, False)
+ except UnknownServiceException as use:
+ raise ConfigValidationException(use.message)
+
+