Commit f39fdb5b authored by Igor Drozdov's avatar Igor Drozdov

Merge branch '347408_cleanup_feature_flag_limit_ssh_key_lifetime' into 'master'

Remove feature flag `ff_limit_ssh_key_lifetime`

See merge request gitlab-org/gitlab!77568
parents 9088d914 23e9f7c0
...@@ -201,11 +201,7 @@ To set a limit on how long these sessions are valid: ...@@ -201,11 +201,7 @@ To set a limit on how long these sessions are valid:
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/1007) in GitLab 14.6 [with a flag](../../../administration/feature_flags.md) named `ff_limit_ssh_key_lifetime`. Disabled by default. > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/1007) in GitLab 14.6 [with a flag](../../../administration/feature_flags.md) named `ff_limit_ssh_key_lifetime`. Disabled by default.
> - [Enabled on self-managed](https://gitlab.com/gitlab-org/gitlab/-/issues/346753) in GitLab 14.6. > - [Enabled on self-managed](https://gitlab.com/gitlab-org/gitlab/-/issues/346753) in GitLab 14.6.
> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/1007) in GitLab 14.7. [Feature flag ff_limit_ssh_key_lifetime](https://gitlab.com/gitlab-org/gitlab/-/issues/347408) removed.
FLAG:
On self-managed GitLab, by default this feature is available. To hide the feature,
ask an administrator to [disable the feature flag](../../../administration/feature_flags.md) named `ff_limit_ssh_key_lifetime`.
On GitLab.com, this feature is not available.
Users can optionally specify a lifetime for Users can optionally specify a lifetime for
[SSH keys](../../../ssh/index.md). [SSH keys](../../../ssh/index.md).
......
...@@ -23,12 +23,12 @@ module EE ...@@ -23,12 +23,12 @@ module EE
end end
def ssh_key_expiration_policy_licensed? def ssh_key_expiration_policy_licensed?
License.feature_available?(:ssh_key_expiration_policy) && ::Feature.enabled?(:ff_limit_ssh_key_lifetime, default_enabled: :yaml) License.feature_available?(:ssh_key_expiration_policy)
end end
override :ssh_key_expiration_policy_enabled? override :ssh_key_expiration_policy_enabled?
def ssh_key_expiration_policy_enabled? def ssh_key_expiration_policy_enabled?
::Gitlab::CurrentSettings.max_ssh_key_lifetime && ssh_key_expiration_policy_licensed? && ::Feature.enabled?(:ff_limit_ssh_key_lifetime, default_enabled: :yaml) ::Gitlab::CurrentSettings.max_ssh_key_lifetime && ssh_key_expiration_policy_licensed?
end end
end end
end end
---
name: ff_limit_ssh_key_lifetime
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75098
rollout_issue_url:
milestone: '14.6'
type: development
group: group::compliance
default_enabled: true
...@@ -87,50 +87,30 @@ RSpec.describe ProfilesHelper do ...@@ -87,50 +87,30 @@ RSpec.describe ProfilesHelper do
describe '#ssh_key_expiration_policy_enabled?' do describe '#ssh_key_expiration_policy_enabled?' do
subject { helper.ssh_key_expiration_policy_enabled? } subject { helper.ssh_key_expiration_policy_enabled? }
context 'when feature flag is enabled' do context 'when is licensed and used' do
before do before do
stub_feature_flags(ff_limit_ssh_key_lifetime: true) stub_licensed_features(ssh_key_expiration_policy: true)
end stub_application_setting(max_ssh_key_lifetime: 10)
context 'when is licensed and used' do
before do
stub_licensed_features(ssh_key_expiration_policy: true)
stub_application_setting(max_ssh_key_lifetime: 10)
end
it { is_expected.to be_truthy }
end end
context 'when is not licensed' do it { is_expected.to be_truthy }
before do end
stub_licensed_features(ssh_key_expiration_policy: false)
end
it { is_expected.to be_falsey } context 'when is not licensed' do
before do
stub_licensed_features(ssh_key_expiration_policy: false)
end end
context 'when is licensed but not used' do it { is_expected.to be_falsey }
before do
stub_licensed_features(ssh_key_expiration_policy: true)
stub_application_setting(max_ssh_key_lifetime: nil)
end
it { is_expected.to be_falsey }
end
end end
context 'when feature flag is disabled' do context 'when is licensed but not used' do
before do before do
stub_feature_flags(ff_limit_ssh_key_lifetime: false) stub_licensed_features(ssh_key_expiration_policy: true)
stub_application_setting(max_ssh_key_lifetime: nil)
end end
context 'when is licensed and used' do
before do
stub_licensed_features(ssh_key_expiration_policy: true)
stub_application_setting(max_ssh_key_lifetime: 10)
end
it { is_expected.to be_falsey } it { is_expected.to be_falsey }
end
end end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment