Skip to content
Snippets Groups Projects
Commit dbc6c1deb269 authored by smriti's avatar smriti
Browse files

Added duo auth config

Duo Auth support as OTP provider is added.
This change will help the omnibus build to add configurations

Changelog: added
MR: https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/6752
parent a950ae672877
No related branches found
No related tags found
2 merge requests!102heptapod#1237: making 0.38 the new oldstable,!92Merging upstream 15.10.0+ce.0
......@@ -572,6 +572,12 @@
# gitlab_rails['forti_token_cloud_client_id'] = 'forti_token_cloud_client_id'
# gitlab_rails['forti_token_cloud_client_secret'] = 's3cr3t'
### DuoAuth authentication settings
# gitlab_rails['duo_auth_enabled'] = false
# gitlab_rails['duo_auth_integration_key'] = 'duo_auth_integration_key'
# gitlab_rails['duo_auth_secret_key'] = 'duo_auth_secret_key'
# gitlab_rails['duo_auth_hostname'] = 'duo_auth.example.com'
### Backup Settings
###! Docs: https://docs.gitlab.com/omnibus/settings/backups.html
......
......@@ -347,6 +347,11 @@
default['gitlab']['gitlab-rails']['forti_authenticator_username'] = nil
default['gitlab']['gitlab-rails']['forti_authenticator_access_token'] = nil
default['gitlab']['gitlab-rails']['duo_auth_enabled'] = false
default['gitlab']['gitlab-rails']['duo_auth_integration_key'] = nil
default['gitlab']['gitlab-rails']['duo_auth_secret_key'] = nil
default['gitlab']['gitlab-rails']['duo_auth_hostname'] = nil
default['gitlab']['gitlab-rails']['forti_token_cloud_enabled'] = false
default['gitlab']['gitlab-rails']['forti_token_cloud_client_id'] = nil
default['gitlab']['gitlab-rails']['forti_token_cloud_client_secret'] = nil
......
......@@ -924,6 +924,18 @@
client_secret: <%= quote(@forti_token_cloud_client_secret) %>
<% end %>
# DuoAuth settings
duo_auth:
# Allow using DuoAuth as OTP provider
enabled: <%= @duo_auth_enabled %>
<% if @duo_auth_enabled %>
# Hostname integration_key and secret key of duo_auth instance
hostname: <%= @duo_auth_hostname %>
integration_key: <%= quote(@duo_auth_integration_key) %>
secret_key: <%= quote(@duo_auth_secret_key) %>
<% end %>
# Shared file storage settings
shared:
path: <%= @shared_path %>
......
require 'chef_helper'
RSpec.describe 'gitlab::gitlab-rails' do
using RSpec::Parameterized::TableSyntax
include_context 'gitlab-rails'
describe 'DuoAuth settings' do
context 'with default values' do
it 'renders gitlab.yml with duo auth disabled' do
expect(gitlab_yml[:production][:duo_auth]).to eq(
enabled: false
)
end
end
context 'with user specified values' do
before do
stub_gitlab_rb(
gitlab_rails: {
duo_auth_enabled: true,
duo_auth_hostname: 'duo_auth.example.com',
duo_auth_integration_key: '1nt3gr4tionKey',
duo_auth_secret_key: '123e4et',
}
)
end
it 'renders gitlab.yml with user specified values' do
expect(gitlab_yml[:production][:duo_auth]).to eq(
enabled: true,
hostname: 'duo_auth.example.com',
integration_key: '1nt3gr4tionKey',
secret_key: '123e4et'
)
end
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment