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

PAYARA-2081 create a new roles allowed cdi annotation #2247

Conversation

michaelranaldo
Copy link
Contributor

No description provided.

@michaelranaldo
Copy link
Contributor Author

jenkins test please

@payara-ci
Copy link
Contributor

Quick build and test passed!

@smillidge smillidge added this to the Payara 4.181 milestone Jan 11, 2018
}

public boolean checkRoles(Roles roles) {
if (roles != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Roles can't/shouldn't really be null in an annotation

*/
public class RolesCDIExtension implements Extension {

void beforeBeanDiscovery(@Observes BeforeBeanDiscovery bbd, BeanManager bm) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Try to avoid abbreviations of variable names, unless very common.

* @default OR
*/
@Nonbinding
String semantics() default "OR";
Copy link
Contributor

Choose a reason for hiding this comment

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

Could possibly be an enum here instead of a String

<artifactId>packages</artifactId>
<version>4.1.2.181-SNAPSHOT</version>
</parent>
<artifactId>roles-package</artifactId>
Copy link
Contributor

Choose a reason for hiding this comment

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

Is "roles-package" the clearest name here one can think of?

@@ -70,6 +70,7 @@
<module>environment-warning</module>
<module>payara-rest-endpoints</module>
<module>rest-monitoring</module>
<module>roles-api</module>
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it really a "roles api"?


void beforeBeanDiscovery(@Observes BeforeBeanDiscovery bbd, BeanManager bm) {
bbd.addInterceptorBinding(Roles.class);
AnnotatedType<RolesCDIInterceptor> cpat = bm.createAnnotatedType(RolesCDIInterceptor.class);
Copy link
Member

Choose a reason for hiding this comment

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

cpat?

* only if the new code is made subject to such option by the copyright
* holder.
*/
package fish.payara.appserver.roles.api;
Copy link
Member

@Pandrex247 Pandrex247 Jan 12, 2018

Choose a reason for hiding this comment

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

In a similar vein to Arjan's comments on the module name, I'm not a fan of this package name - this isn't an api, it's an interceptor.

this.securityContext = CDI.current().select(SecurityContext.class).get();
}


Copy link
Member

Choose a reason for hiding this comment

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

2 more empty lines than necessary

import org.glassfish.security.common.Role;

/**
*
Copy link
Member

Choose a reason for hiding this comment

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

Description would be nice :)

@michaelranaldo michaelranaldo force-pushed the PAYARA-2081-Create-A-New-Roles-Allowed-CDI-Annotation branch 4 times, most recently from 9805fa9 to dd1eeda Compare January 12, 2018 15:35
@michaelranaldo michaelranaldo dismissed arjantijms’s stale review January 12, 2018 15:40

Added request changes and updated copyright to 2018

@michaelranaldo michaelranaldo force-pushed the PAYARA-2081-Create-A-New-Roles-Allowed-CDI-Annotation branch from dd1eeda to 10b3c4e Compare January 12, 2018 15:42
@michaelranaldo michaelranaldo force-pushed the PAYARA-2081-Create-A-New-Roles-Allowed-CDI-Annotation branch from 10b3c4e to 8ee6c4e Compare January 12, 2018 15:43
@michaelranaldo
Copy link
Contributor Author

jenkins test please

@payara-ci
Copy link
Contributor

Quick build and test passed!

@Pandrex247 Pandrex247 merged commit 04c87c0 into payara:master Jan 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants