Skip to content

DSL nested builder for HTTP security #7046

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

Merged
merged 25 commits into from
Jul 12, 2019

Conversation

eleftherias
Copy link
Contributor

Issue: gh-5557

@eleftherias eleftherias force-pushed the gh-5557-dsl-nested-builder branch 2 times, most recently from 2f9990e to eeabb5c Compare June 28, 2019 20:19
@eleftherias eleftherias changed the title DSL nested builder for headers, csrf, exception handling, logout DSL nested builder for HTTP security Jun 28, 2019
@eleftherias eleftherias force-pushed the gh-5557-dsl-nested-builder branch from eeabb5c to 8931800 Compare July 4, 2019 19:14
@eleftherias eleftherias force-pushed the gh-5557-dsl-nested-builder branch from 3eccb45 to ce98f79 Compare July 9, 2019 19:33
@eleftherias eleftherias force-pushed the gh-5557-dsl-nested-builder branch from ce98f79 to 4b2539d Compare July 9, 2019 20:11
@@ -1,5 +1,5 @@
/*
Copy link
Contributor Author

Choose a reason for hiding this comment

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

featurePolicy() has not been updated to allow lambda configuration.
This is because there is no reasonable default for the policyDirectives argument.
Instead, it can be the last configuration for headers().

http
				.headers(headers ->
					headers
						.defaultsDisabled()
						.referrerPolicy(referrerPolicy ->
								referrerPolicy.policy(ReferrerPolicy.SAME_ORIGIN)
						)
						.featurePolicy("")
				);

*/
public OpenIDLoginConfigurer<H> attributeExchange(Customizer<AttributeExchangeConfigurer> attributeExchangeCustomizer)
throws Exception {
AttributeExchangeConfigurer attributeExchangeConfigurer = new AttributeExchangeConfigurer(".*");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The default attribute exchange identifier pattern is ".*" to match everything. It can be updated using the new identifierPattern() method.

* @see AttributeExchangeConfigurer#attribute(String)
*/
private AttributeConfigurer() {
this.name = "default-attribute";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The default attribute name is "default-attribute". This is primarily to avoid a NullPointerException, users should override the name in the name() setter.

@rwinch rwinch self-assigned this Jul 12, 2019
@rwinch rwinch added in: config An issue in spring-security-config status: duplicate A duplicate of another issue type: enhancement A general enhancement labels Jul 12, 2019
@rwinch rwinch added this to the 5.2.0.RC1 milestone Jul 12, 2019
@rwinch rwinch merged commit ea54d90 into spring-projects:master Jul 12, 2019
@eleftherias eleftherias deleted the gh-5557-dsl-nested-builder branch August 26, 2019 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: config An issue in spring-security-config status: duplicate A duplicate of another issue type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants