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 MiqTask#deliver and execute #1249

Closed
wants to merge 1 commit into from
Closed

Conversation

kbrock
Copy link
Member

@kbrock kbrock commented Feb 23, 2024

Provisioning RequestTasks:

  • deliver to kick off the before and followup workflow
  • execute will kick off the main meat

@kbrock
Copy link
Member Author

kbrock commented Feb 23, 2024

update:

  • Rebased
  • Fixed whitespace, and unused parameter

rubocop:

  • Left api_resource with an actual block - follows the pattern better

config/api.yml Outdated
Comment on lines 3236 to 3237
- :name: deliver
:identifier: miq_request_control
- :name: execute
:identifier: miq_request_control
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure here - This would give users with the ability to cancel the requests to also execute and deliver, which is really a system level task - I wonder if this should be super admin only or something 🤔

Copy link
Member Author

@kbrock kbrock Feb 23, 2024

Choose a reason for hiding this comment

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

@Fryguy did you just say service_admin or miq_request_edit, ae_miq_request_edit?

only super admin I know is everything

Copy link
Member

Choose a reason for hiding this comment

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

I said that I don't think regular users should be able to access this endpoint. If there is such a thing as service_admin, perhaps? We run automate/workflows as super admin which is why I said super admin.

Copy link
Member Author

Choose a reason for hiding this comment

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

this will be using the authentication record that workflow/floe is passing. (api_user)

@agrare Do you typically pass superadmin to floe?
Do you feel that is what customers should do?

Copy link
Member

Choose a reason for hiding this comment

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

I had imagined that the user ordering the service would be the one posting to the API, an admin would create the workflows and map what credentials would be used but at order time it would be the unprivileged user account

Copy link
Member Author

@kbrock kbrock Mar 7, 2024

Choose a reason for hiding this comment

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

Most of these tasks will talk to the API and want to act as the requesting user.

This endpoint is basically saying "All the workflows have been run. All the variables have been figured out. Let's talk with vmware and make the actual request happen." This is viable coming from an admin role.

The current vmware specific workflow has:

  • vmware admin auth
  • miq requestor user auth

So it would make sense to have:

  • miq admin auth (to make provider privileged requests)
  • miq requestor user auth (to do stuff as user privileges)

Just not sure the best way to pass the admin auth

Copy link
Member

Choose a reason for hiding this comment

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

I'm lost now about who and when - let's discuss over voice and maybe draw it out.

@kbrock kbrock changed the title Add MiqTask#deliver and execute [WIP] Add MiqTask#deliver and execute Mar 29, 2024
@kbrock kbrock added the wip label Mar 29, 2024
@kbrock
Copy link
Member Author

kbrock commented Mar 29, 2024

WIP: testing ensuring it was approved

@@ -3233,6 +3233,8 @@
:post:
- :name: cancel
:identifier: miq_request_control
- :name: execute
:identifier: miq_request_control
Copy link
Member

Choose a reason for hiding this comment

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

Continung from #1249 (comment)

I still don't like this permission here...something feels off about it. I admit that miq_request_control is used for cancel, but being able to cancel your own request is very different from executing it.

Copy link
Member Author

Choose a reason for hiding this comment

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

added 'you can only execute this if it has been approved' feels like it lessens the request.

@kbrock kbrock changed the title [WIP] Add MiqTask#deliver and execute Add MiqTask#deliver and execute Mar 29, 2024
@miq-bot
Copy link
Member

miq-bot commented Mar 29, 2024

Checked commit kbrock@fe6fd8e with ruby 2.7.8, rubocop 1.56.3, haml-lint 0.51.0, and yamllint
1 file checked, 0 offenses detected
Everything looks fine. 🍪

@kbrock
Copy link
Member Author

kbrock commented May 23, 2024

we are using a builtin instead

@kbrock kbrock closed this May 23, 2024
@kbrock kbrock deleted the task_execute branch May 23, 2024 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants