-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Public Role APIs #20732
Merged
Merged
Public Role APIs #20732
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
c2474b2
Beginning to work on external role management APIs
kobelb 50e4fc1
Refactoring GET tests and adding more permutations
kobelb 366df0f
Adding test for excluding other resources
kobelb a03ac1b
Adding get role tests
kobelb 55f59b3
Splitting out the endpoints, or else it's gonna get overwhelming
kobelb 25ddb7b
Splitting out the post and delete actions
kobelb 35a7def
Beginning to work on POST and the tests
kobelb c9a64c6
Posting the updated role
kobelb 70862b2
Adding update tests
kobelb da8d5db
Modifying the UI to use the new public APIs
kobelb 0abe3b6
Removing internal roles API
kobelb 7c22748
Moving the rbac api integration setup tests to use the public role apis
kobelb e9f8a73
Testing field_security and query
kobelb 3b1ddc3
Adding create role tests
kobelb cff2b89
We can't update the transient_metadata...
kobelb 5ee5d23
Removing debugger
kobelb 2072348
Update and delete tests
kobelb 3e9e8bd
Returning a 204 when POSTing a Role.
kobelb fa03390
Switching POST to PUT and roles to role
kobelb 2566043
We don't need the rbacApplication client-side anymore
kobelb 77ab30b
Adding delete route tests
kobelb 694ed25
Using not found instead of not acceptable, as that's more likely
kobelb 4096ae0
Only allowing us to PUT known Kibana privileges
kobelb 941cf2b
Removing transient_metadata
kobelb 7bcaac7
Removing one letter variable names
kobelb f00cb3e
Merge remote-tracking branch 'upstream/security-app-privs' into exter…
kobelb b599fda
Using PUT instead of POST when saving roles
kobelb 8b7cb3b
Fixing broken tests
kobelb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
x-pack/plugins/security/server/routes/api/public/roles/delete.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import _ from 'lodash'; | ||
import Joi from 'joi'; | ||
import { wrapError } from '../../../../lib/errors'; | ||
|
||
export function initDeleteRolesApi(server, callWithRequest, routePreCheckLicenseFn) { | ||
server.route({ | ||
method: 'DELETE', | ||
path: '/api/security/role/{name}', | ||
handler(request, reply) { | ||
const name = request.params.name; | ||
return callWithRequest(request, 'shield.deleteRole', { name }).then( | ||
() => reply().code(204), | ||
_.flow(wrapError, reply)); | ||
}, | ||
config: { | ||
validate: { | ||
params: Joi.object() | ||
.keys({ | ||
name: Joi.string() | ||
.required(), | ||
}) | ||
.required(), | ||
}, | ||
pre: [routePreCheckLicenseFn] | ||
} | ||
}); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do we have a precedent for how to version our public APIs yet? I'm concerned that not including a version number will prevent us from iterating in minor versions. Or at the other side of the spectrum, these public APIs could inadvertently become fluid like our plugin API, where users have to tie to a specific minor/patch release.
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.
We want our public APIs to be versioned with our "product version" so that when we do a major release, we are able to make breaking changes to the APIs. If we had to do a breaking change in a minor, we'd have to put it in the release notes and have a very good reason for doing so. We don't want "multiple versions" for stuff like this.