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

Remove redundant call to _authenticate API after access token is created. #82980

Merged
merged 3 commits into from
Nov 10, 2020

Conversation

azasypkin
Copy link
Member

@azasypkin azasypkin commented Nov 9, 2020

Since elastic/elasticsearch#59685 is resolved now (7.11.0+) we can proceed and remove redundant _authenticate calls after we create any kind of access tokens (Token/SAML/OIDC/Kerberos/PKI) that would improve login performance and make code simpler overall.

Fixes: #80952

@azasypkin azasypkin added Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! enhancement New value added to drive a business result Feature:Security/Authentication Platform Security - Authentication v8.0.0 release_note:skip Skip the PR/issue when compiling release notes 7.11.0 labels Nov 9, 2020
@@ -4,6 +4,9 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { AuthenticatedUser } from '../../common/model';

export type Authentication = Omit<AuthenticatedUser, 'authentication_provider'>;
Copy link
Member Author

Choose a reason for hiding this comment

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

note: not super happy about the name of this type, but don't have any other ideas what the type name of authentication response field could be ....

Copy link
Contributor

Choose a reason for hiding this comment

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

For reference, we discussed the naming offline and decided to name this field AuthenticationInfo.

While being short, Authentication is slightly meaningless and could mean many things to different people.

According to the ES docs the authentication field represents:

User information such as their username, the roles that are assigned to the user, any assigned metadata, and information about the realms that authenticated and authorized the user

So renaming this type to AuthenticationInfo makes that a bit clearer.

@azasypkin azasypkin marked this pull request as ready for review November 9, 2020 18:49
@azasypkin azasypkin requested a review from a team as a code owner November 9, 2020 18:49
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-security (Team:Security)

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@thomheymann thomheymann left a comment

Choose a reason for hiding this comment

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

LGTM (with my limited knowledge) :)

@azasypkin azasypkin merged commit a63c390 into elastic:master Nov 10, 2020
@azasypkin azasypkin deleted the issue-80952-redundant-auth-calls branch November 10, 2020 17:12
azasypkin added a commit to azasypkin/kibana that referenced this pull request Nov 10, 2020
…eated. (elastic#82980)

# Conflicts:
#	.github/CODEOWNERS
#	x-pack/plugins/security/server/authentication/providers/saml.test.ts
#	x-pack/plugins/security/server/authentication/providers/saml.ts
@jen-huang jen-huang added v7.11.0 and removed 7.11.0 labels Nov 10, 2020
@azasypkin
Copy link
Member Author

7.x/7.11.0: 660f712

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported enhancement New value added to drive a business result Feature:Security/Authentication Platform Security - Authentication release_note:skip Skip the PR/issue when compiling release notes Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove redundant call to _authenticate API after access token is created
5 participants