Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate against Banned-Passwords List #9727

Merged
merged 15 commits into from Sep 26, 2023
Merged

Validate against Banned-Passwords List #9727

merged 15 commits into from Sep 26, 2023

Conversation

AlexAndBear
Copy link
Contributor

@AlexAndBear AlexAndBear commented Sep 23, 2023

Description

Related Issue

Motivation and Context

How Has This Been Tested?

  • test environment:
  • test case 1:
  • test case 2:
  • ...

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

  • ...

@update-docs
Copy link

update-docs bot commented Sep 23, 2023

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@AlexAndBear AlexAndBear changed the title Issues/9726 Validate against Banned-Passwords List Sep 23, 2023
@@ -21,6 +21,7 @@ services:
FRONTEND_SEARCH_MIN_LENGTH: "2"
FRONTEND_OCS_ENABLE_DENIALS: "true"
FRONTEND_FULL_TEXT_SEARCH_ENABLED: "true"
FRONTEND_PASSWORD_POLICY_BANNED_PASSWORDS_LIST: '/etc/ocis/password-policy-banned-passwords.txt'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added some demo data, can't hurt

@AlexAndBear
Copy link
Contributor Author

issue with generating passwords, does't emit input and therefore error message won't be resettet.

const { $gettext } = useGettext()
const password = ref(props.value)
const showPassword = ref(false)
const passwordEntered = ref(false)
const copyPasswordIconInitial = 'file-copy'
const copyPasswordIcon = ref(copyPasswordIconInitial)

const hasError = computed(() => {
return (attrs?.class as string)?.includes('oc-text-input-danger')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not ideal, but I don't want to add more component props

}
},

checkLinkToUpdate({ link, onSuccess = () => {} }) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed all those onSuccess and onError callbacks because they actually weren't used and added to confusion.

onCancel: () => store.dispatch('hideModal'),
onConfirm: async (password) => {
if (!password || password.trim() === '') {
store.dispatch('showErrorMessage', {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed anymore as built in default password policy. Also closing the modal instantly was not correct, because we might want to show an error in the modal.

@@ -30,22 +30,12 @@ export function showQuickLinkPasswordModal({ $gettext, store, passwordPolicyServ
inputGeneratePasswordMethod: () => passwordPolicyService.generatePassword(),
inputLabel: $gettext('Password'),
inputType: 'password',
onInput: () => store.dispatch('setModalInputErrorMessage', ''),
onPasswordChallengeCompleted: () => store.dispatch('setModalConfirmButtonDisabled', false),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed those in the last pr.

Object.keys(this.capability).length === 0 ||
(Object.keys(this.capability).length === 1 &&
Object.keys(this.capability)[0] === 'max_characters')
!this.capability.min_characters &&
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are always set, defaults to 0, so had to change the logic

}

this.showMessage({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be here.

@sonarcloud
Copy link

sonarcloud bot commented Sep 25, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

36.6% 36.6% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@AlexAndBear AlexAndBear merged commit c7e33e1 into master Sep 26, 2023
3 of 4 checks passed
@delete-merged-branch delete-merged-branch bot deleted the issues/9726 branch September 26, 2023 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[web] Validate against Banned-Passwords List
2 participants