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

Add "MFA Verified" check to workflowengine #36045

Closed

Conversation

michielbdejong
Copy link
Contributor

This PR goes together with:

It allows the creation of work flows that depend on whether the logged-in user has passed MFA Verification for the current session or not.

$this->container->query(FileName::class),
$this->container->query(FileSize::class),
$this->container->query(FileSystemTags::class),
$this->container->query(MfaVerified::class),

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OCP\IContainer::query has been marked as deprecated
apps/workflowengine/lib/Check/MfaVerified.php Outdated Show resolved Hide resolved
apps/workflowengine/lib/Check/MfaVerified.php Outdated Show resolved Hide resolved
class: 'OCA\\WorkflowEngine\\Check\\MfaVerified',
name: t('workflowengine', 'MFA Verified'),
operators: [
{ operator: 'is', name: t('workflowengine', 'is verified?') },
Copy link
Member

Choose a reason for hiding this comment

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

and is not?

That would allow e.g. to use access control to block access to folders for people that did not 2fa

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is a default boolean dropdown (@mrvahedi68 will provide some screenshots of it later today); the operatorof the check is always "is" and the value of the check can be "true" or "false".

So that way both "MFA verified is true" and "MFA verified is false" are available. Indeed, for blocking access to a folder you would create a rule to "block access" if "MFA verified is false".

Choose a reason for hiding this comment

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

You can see here to screenshots of it. We have a dropdown with only one field 'is verified? and another textbox with a hint (true) that user can input anything. So We have a check at this function to validate user input. (you can see a related screenshot below). Based on this rule admin can restrict access to files by MFA verified is false or true.

closed
opened
invalid

Copy link
Member

Choose a reason for hiding this comment

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

Ah okay. Because that is trouble some with translations and admins using different langauges, I would recomment to:

  • Operation:
    • is
    • is not
  • Value (hard coded to):
    • verified

Copy link
Member

Choose a reason for hiding this comment

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

When you use a dedicated component you can even remove the input field for the value.

Choose a reason for hiding this comment

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

I changed the source and use the new approach you described above.
Now we have only one drop-down with two values and no other inputs.
You can find screenshots at the flowing.
@nickvergessen

opened
selected

@michielbdejong
Copy link
Contributor Author

Not sure why checkers is failing in https://drone.nextcloud.com/nextcloud/server/28345/1/3
The failure for integration-contacts-menu seems unrelated.

@michielbdejong
Copy link
Contributor Author

Ah, need to run bash build/autoloaderchecker.sh

@michielbdejong
Copy link
Contributor Author

michielbdejong commented Jan 16, 2023

The failing test seems unrelated. @mrvahedi68 can you sign off your commits?

@nickvergessen
Copy link
Member

The failing test seems unrelated

Failing lint and node are related. Fixable with:

npm ci && npm run lint:fix
make build-js-production

And then commit.

If you fail to do that, that's no problem, we can easily take that over.

Author: MohammadReza Vahedi (@mrvahedi68)

Signed-off-by: Michiel de Jong <michiel@unhosted.org>
Signed-off-by: Michiel de Jong <michiel@unhosted.org>
Signed-off-by: Michiel de Jong <michiel@unhosted.org>
Signed-off-by: Michiel de Jong <michiel@unhosted.org>
Signed-off-by: Michiel de Jong <michiel@unhosted.org>
@skjnldsv skjnldsv mentioned this pull request Feb 23, 2023
@michielbdejong
Copy link
Contributor Author

This PR seems to be using the wrong branch, will recreate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants