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-2575 Yubikey Integration #2702

Merged
merged 24 commits into from May 29, 2018
Merged

PAYARA-2575 Yubikey Integration #2702

merged 24 commits into from May 29, 2018

Conversation

MarkWareham
Copy link
Contributor

PAYARA-2575 Yubikey Integration

@@ -138,5 +138,12 @@
<version>${project.version}</version>
<type>zip</type>
</dependency>
<!-- Yubikey Authentication -->
Copy link
Contributor

Choose a reason for hiding this comment

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

Copyright needs updating in this file

*
* When distributing the software, include this License Header Notice in each
* file and include the License file at packager/legal/LICENSE.txt.
-->
Copy link
Contributor

Choose a reason for hiding this comment

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

Use longer copyright text, as you did in the pom.xml

# language governing permissions and limitations under the License.
#
# When distributing the software, include this License Header Notice in each
# file and include the License file at packager/legal/LICENSE.txt.
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, use longer copyright

* @author Mark Wareham
*/
@SuppressWarnings("AnnotationAsSuperInterface")
public class TwoFactorAuthenticationMechanismDefinitionAnnotationLiteral
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this class actually do anything?

*
* @author Mark Wareham
*/
public class YubicoClientFactory {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be done as an application-scoped CDI bean instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. This way the YubicoClient is per-app

if (fullKey.isEmpty()){
return "";
}
if(fullKey.length()<12){
Copy link
Contributor

Choose a reason for hiding this comment

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

fullKey.length<12 makes fulKey.isEmpty redundant as the same result would be returned by this one

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking of StringUtils.isEmpty() which checks whitespace insensitively

@Cousjava
Copy link
Contributor

Cousjava commented May 2, 2018

Also Yubikey needs adding to embedded and web build

@MarkWareham MarkWareham changed the title Yubikey PAYARA-2575 Yubikey Integration May 2, 2018
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface TwoFactorAuthenticationMechanismDefinition {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this would be better named something more like YubikeyMechanismDefiniton, as a 2FA definition won't necessarily use Yubikey as one of its methods. If you do stick with TwoFactorAuthenticationMechanismDefinition, then using yubikey should be another option inside it.

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 2FA Mechanism is completely independent of yubikey. You could use the 2FA mech with an LDAPIdentityStore and a DatabaseIdentityStore for example. It selects the identity stores based on what's defined in the app and their priority

Copy link
Contributor

Choose a reason for hiding this comment

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

This is still not giving the option of multiple authentication mechanism, which is what 2FA is, instead this is making multiple identity stores used in an AND system rather than the default OR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, it does not allow two authentication mechanisms, but two identity stores. I will rename to avoid confusion

Copy link
Contributor

@smillidge smillidge left a comment

Choose a reason for hiding this comment

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

I would like to see more integration with Payara Server. For example I can't see any way that the annotation values set by a developer can be overridden either using the domain.xml, environment properties or using Microprofile config api.
Also some integration with Request Tracing would be useful and perhaps at a stretch the security auditing modules (although that may happen within Soteria)

@smillidge
Copy link
Contributor

Also are the lambdas strictly necessary as this will push the feature to be Payara 5 only.

@Pandrex247
Copy link
Member

@MarkWareham If you hadn't noticed, this now has a conflict :)

@Cousjava
Copy link
Contributor

@MarkWareham My review comments are still relevant

@arjantijms
Copy link
Contributor

For this issue the same comment holds as #2704 (comment)

@arjantijms arjantijms added the PR: DO NOT MERGE Don't merge PR until further notice label May 22, 2018
@MarkWareham
Copy link
Contributor Author

jenkins test please

Copy link
Contributor

@Cousjava Cousjava left a comment

Choose a reason for hiding this comment

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

Generally looks fine


String priorityExpression() default "";

String yubikeyAPIClientIDExpression() default "";
Copy link
Contributor

Choose a reason for hiding this comment

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

A Javadoc comment here would be useful

@Cousjava Cousjava dismissed their stale review May 25, 2018 16:16

Changes made

@payara-ci
Copy link
Contributor

Quick build and test passed!

@Pandrex247 Pandrex247 merged commit 26d8426 into payara:master May 29, 2018
@MarkWareham MarkWareham removed PR: DO NOT MERGE Don't merge PR until further notice 3:DevInProgress labels Jun 14, 2018
MarkWareham pushed a commit to MarkWareham/Payara that referenced this pull request Jun 18, 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.

None yet

8 participants