-
Notifications
You must be signed in to change notification settings - Fork 898
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
delete authentication in provider #14307
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,18 @@ | ||
module Api | ||
class AuthenticationsController < BaseController | ||
def delete_resource(type, id, _data = {}) | ||
auth = resource_search(id, type, collection_class(:authentications)) | ||
raise 'type not currently supported' unless auth.respond_to?(:delete_in_provider_queue) | ||
task_id = auth.delete_in_provider_queue | ||
action_result(true, "Deleting #{authentication_ident(auth)}", :task_id => task_id) | ||
rescue => err | ||
action_result(false, err.to_s) | ||
end | ||
|
||
private | ||
|
||
def authentication_ident(auth) | ||
"Authentication id:#{auth.id} name: '#{auth.name}'" | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -233,7 +233,7 @@ | |
:options: | ||
- :collection | ||
- :subcollection | ||
:verbs: *gpd | ||
:verbs: *gp | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is the DELETE action removed on resource. You can add that back. We support DELETE on resources that are zapped async, i.e. /api/providers, if user sends a DELETE HTTP action, it's for fire and forget, they won't care about the task_id. If they care, they'd simply use the delete POST action and leverage our action result signature. |
||
:klass: Authentication | ||
:collection_actions: | ||
:get: | ||
|
@@ -249,9 +249,6 @@ | |
:post: | ||
- :name: delete | ||
:identifier: embedded_automation_manager_credentials_delete | ||
:delete: | ||
- :name: delete | ||
:identifier: embedded_automation_manager_credentials_delete | ||
:subcollection_actions: | ||
:get: | ||
- :name: read | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe update the message. maybe something like "Delete not supported for #{authentication_ident(auth)}"