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

Output Subject Claim as Identity in Logging interceptor #946

Merged
merged 21 commits into from
Aug 31, 2020
Merged

Output Subject Claim as Identity in Logging interceptor #946

merged 21 commits into from
Aug 31, 2020

Conversation

mrzzy
Copy link
Collaborator

@mrzzy mrzzy commented Aug 12, 2020

What this PR does / why we need it:

  • Moves subjectClaim option from feast.authorization.options to feast.authentication.options
    • Since subjectClaim options is used by GrpcMessageInterceptor even when only authentication is enabled.
  • Update GrpcMessageInterceptor to output subject claim as identity.
    • ie for the google authentication provider, this would output the users email as identity.
    • uses subject claim configed via feast.authentication.options.subjectClaim.
  • Merges feast-auth module into feast-common module to prevent a circular dependency.
  • Disables Spring Security autoconfiguration beans as security is not yet implemented for Job Controller.

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

* Moved `subjectClaim` option from feast.authorization.options to feast.authentication.options
* Message Audit Logs will now output configured Subject Claim as Identity instead of Subject when feast.authentication.options.subjectClaim is set

@mrzzy
Copy link
Collaborator Author

mrzzy commented Aug 13, 2020

/test test-end-to-end-redis-cluster

@mrzzy
Copy link
Collaborator Author

mrzzy commented Aug 13, 2020

/test test-end-to-end-auth

3 similar comments
@mrzzy
Copy link
Collaborator Author

mrzzy commented Aug 13, 2020

/test test-end-to-end-auth

@mrzzy
Copy link
Collaborator Author

mrzzy commented Aug 13, 2020

/test test-end-to-end-auth

@mrzzy
Copy link
Collaborator Author

mrzzy commented Aug 13, 2020

/test test-end-to-end-auth

@mrzzy
Copy link
Collaborator Author

mrzzy commented Aug 13, 2020

/test test-end-to-end

@mrzzy mrzzy added compat/breaking Breaking user-facing change kind/feature New feature or request labels Aug 14, 2020
@@ -54,6 +52,8 @@
private String provider;

// K/V options to initialize the provider with
// Key for Subject Claim option which sets the name of the subject claim field in tokens.
Copy link
Member

Choose a reason for hiding this comment

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

Should the comment above this one be below at the options?

@mrzzy
Copy link
Collaborator Author

mrzzy commented Aug 21, 2020

/retest

@woop
Copy link
Member

woop commented Aug 21, 2020

/lgtm

@mrzzy
Copy link
Collaborator Author

mrzzy commented Aug 24, 2020

/retest

@mrzzy
Copy link
Collaborator Author

mrzzy commented Aug 24, 2020

/test test-end-to-end

// When security is enabled, should only allow unauthenticated access to actuator and
// metrics endpoints.
.antMatchers("/")
// .antMatchers("/actuator/**", "/metrics/**")
Copy link
Member

Choose a reason for hiding this comment

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

Does this still have to be so permissive?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Opted for disabling Spring Security autoconfiguration beans instead of hardcoding endpoints to disable in WebSecurityConfig.

@@ -731,6 +814,9 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<doclint>all</doclint>
Copy link
Member

Choose a reason for hiding this comment

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

What is this for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Originally doclint is enabled via the maven-compiler-plugin option here. This enables doclint from maven-javadoc-plugin so that we can disable doclint for classpath of the OpenAPI client which fails doclint.

Copy link
Member

Choose a reason for hiding this comment

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

But there is an exclusion. Why did this work in the past but not any more?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm am not entirely sure myself.
The effect of this move is that doclint moves from the compile maven lifecycle to the test maven lifecycle.
Doclint still works and flags issues with the docs.

mrzzy added 21 commits August 27, 2020 16:16
…tead of just id

For the 'google' authentication provider this means that the email would
be output as identity instead of just a user id
* This is done as subjectClaim would be used even when only
  authentication is enabled.
* For HttpAuthorizationProvider, which requires both authentication and
  authorization options, the options maps are merged together.
…ding dummy WebSecurityConfig

As GrpcMessageInterceptor is moved feast-auth package to prevent a
circular dependency, jobcontroller has to import feast-auth to get
GrpcMessageInterceptor. feast-auth also imports spring security,
which automatically requires WebSecurityConfigurerAdapter to be present
in the spring application context.

Commit provides a dummy WebSecurityConfigurerAdapter required to
statisfy spring.
@mrzzy
Copy link
Collaborator Author

mrzzy commented Aug 28, 2020

/test @feast-ci-bot
test-end-to-end-redis-cluster

@mrzzy
Copy link
Collaborator Author

mrzzy commented Aug 28, 2020

/test test-end-to-end-redis-cluster

@feast-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mrzzy, woop

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@woop
Copy link
Member

woop commented Aug 31, 2020

/lgtm

@feast-ci-bot feast-ci-bot merged commit b61c3a1 into feast-dev:master Aug 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved compat/breaking Breaking user-facing change kind/feature New feature or request lgtm size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants