-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow setting the locked state of the admin user (#161)
- Loading branch information
1 parent
7978221
commit 50a9eee
Showing
4 changed files
with
66 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@openproject/helm-charts": minor | ||
--- | ||
|
||
Allow setting admin user seeder as locked |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -318,12 +318,15 @@ openproject: | |
|
||
## Define admin user details | ||
# only applicable on first installation | ||
# Note: Only applicable for versions >= 13.0 | ||
# c.f. https://www.openproject.org/docs/installation-and-operations/configuration/#initial-admin-user-creation | ||
admin_user: | ||
password: "admin" | ||
password_reset: "true" | ||
name: "OpenProject Admin" | ||
mail: "[email protected]" | ||
# Uncomment if you want to lock the user after creation | ||
# Relevant for automated deployments that seed LDAP or SSO | ||
# locked: true | ||
|
||
## Define OpenID Connect providers | ||
oidc: | ||
|
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,54 @@ | ||
# frozen_string_literal: true | ||
require 'spec_helper' | ||
|
||
describe 'admin user seeder configuration' do | ||
let(:template) { HelmTemplate.new(default_values) } | ||
|
||
subject { template.dig('Secret/optest-openproject-core', 'stringData') } | ||
|
||
context 'when setting the seeder' do | ||
let(:default_values) do | ||
HelmTemplate.with_defaults(<<~YAML | ||
openproject: | ||
admin_user: | ||
name: "Foo Bar" | ||
YAML | ||
) | ||
end | ||
|
||
it 'adds a respective ENV', :aggregate_failures do | ||
expect(subject) | ||
.to include("OPENPROJECT_SEED_ADMIN_USER_NAME" => "Foo Bar") | ||
|
||
expect(subject) | ||
.not_to include("OPENPROJECT_SEED_ADMIN_USER_LOCKED" => "true") | ||
end | ||
end | ||
|
||
context 'when setting the admin as locked' do | ||
let(:default_values) do | ||
HelmTemplate.with_defaults(<<~YAML | ||
openproject: | ||
admin_user: | ||
locked: true | ||
YAML | ||
) | ||
end | ||
|
||
it 'adds a respective ENV', :aggregate_failures do | ||
expect(subject) | ||
.to include("OPENPROJECT_SEED_ADMIN_USER_LOCKED" => "true") | ||
end | ||
end | ||
|
||
context 'when leaving defaults' do | ||
let(:default_values) do | ||
HelmTemplate.with_defaults({}) | ||
end | ||
|
||
it 'the name is the default', :aggregate_failures do | ||
expect(subject) | ||
.to include("OPENPROJECT_SEED_ADMIN_USER_NAME" => "OpenProject Admin") | ||
end | ||
end | ||
end |