Skip to content

Commit

Permalink
Merge pull request #2204 from hazendaz/master
Browse files Browse the repository at this point in the history
[cleanup] Minor code cleanup
  • Loading branch information
hazendaz authored Jan 21, 2024
2 parents f5f9b91 + 032067b commit cdf151b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 28 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ WAFFLE - Windows Authentication Framework

WAFFLE is a native Windows Authentication Framework consisting of two C# and Java libraries that perform functions related to Windows authentication, supporting Negotiate, NTLM and Kerberos. Waffle also includes libraries that enable drop-in Windows Single Sign On for popular Java web servers, when running on Windows. While Waffle makes it ridiculously easy to do Windows Authentication in Java, on Windows, Waffle does not work on *nix(UNIX-like).

Unlike many other implementations Waffle on Windows does not require any server-side Kerberos keytab setup, it's a drop-in solution. You can see it in action in [this slightly blurry video](https://www.youtube.com/watch?v=LmTwbOh0hBU) produced for [TeamShatter.com](http://www.teamshatter.com/topics/general/team-shatter-exclusive/securing-java-applications-with-smart-cards-and-single-sign-on/).
Unlike many other implementations Waffle on Windows does not require any server-side Kerberos keytab setup, it's a drop-in solution. You can see it in action in [this slightly blurry video](https://www.youtube.com/watch?v=LmTwbOh0hBU) produced for [TeamShatter.com](http://www.teamshatter.com/topics/general/team-shatter-exclusive/securing-java-applications-with-smart-cards-and-single-sign-on/).

Sites
-----
Expand Down Expand Up @@ -69,7 +69,7 @@ Features
How do I resolve JNA `NoClassDefFound` errors?
----------------------------------------------
WAFFLE uses the latest version of JNA, which may conflict with other dependencies your project (or its parent) includes. If you experience issues with `NoClassDefFound` errors for JNA artifacts, consider one or more of the following steps to resolve the conflict:
* Listing WAFFLE earlier (or first) in your dependency list
* Listing WAFFLE earlier (or first) in your dependency list
* Specifying the most recent version of JNA as a dependency
* If you are using a parent (e.g., Spring Boot) that includes JNA as a dependency, override the `jna.version` property

Expand All @@ -93,12 +93,12 @@ Contributing
* [Set Up a Development Environment](Docs/SettingUpDevelopmentEnvironment.md).
* Make your code changes. Don't forget tests.
* Update [CHANGELOG](CHANGELOG.md).
* Make pull requests. Bonus points for topic branches.
* Make pull requests. Bonus points for topic branches.

License and Copyright
---------------------

Copyright (c) [Application Security Inc.](https://www.trustwave.com/Company/AppSecInc-is-now-Trustwave/), 2010-2020 and Contributors.
Copyright (c) [Application Security Inc.](https://www.trustwave.com/Company/AppSecInc-is-now-Trustwave/), 2010-2020 and Contributors.

This project is licensed under the [MIT License](https://github.com/Waffle/waffle/blob/master/LICENSE).

Expand Down
8 changes: 4 additions & 4 deletions Source/JNA/src/site/markdown/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ WAFFLE - Windows Authentication Framework

WAFFLE is a native Windows Authentication Framework consisting of two C# and Java libraries that perform functions related to Windows authentication, supporting Negotiate, NTLM and Kerberos. Waffle also includes libraries that enable drop-in Windows Single Sign On for popular Java web servers, when running on Windows. While Waffle makes it ridiculously easy to do Windows Authentication in Java, on Windows, Waffle does not work on *nix(UNIX-like).

Unlike many other implementations Waffle on Windows does not require any server-side Kerberos keytab setup, it's a drop-in solution. You can see it in action in [this slightly blurry video](https://www.youtube.com/watch?v=LmTwbOh0hBU) produced for [TeamShatter.com](http://www.teamshatter.com/topics/general/team-shatter-exclusive/securing-java-applications-with-smart-cards-and-single-sign-on/).
Unlike many other implementations Waffle on Windows does not require any server-side Kerberos keytab setup, it's a drop-in solution. You can see it in action in [this slightly blurry video](https://www.youtube.com/watch?v=LmTwbOh0hBU) produced for [TeamShatter.com](http://www.teamshatter.com/topics/general/team-shatter-exclusive/securing-java-applications-with-smart-cards-and-single-sign-on/).

Sites
-----
Expand Down Expand Up @@ -69,7 +69,7 @@ Features
How do I resolve JNA `NoClassDefFound` errors?
----------------------------------------------
WAFFLE uses the latest version of JNA, which may conflict with other dependencies your project (or its parent) includes. If you experience issues with `NoClassDefFound` errors for JNA artifacts, consider one or more of the following steps to resolve the conflict:
* Listing WAFFLE earlier (or first) in your dependency list
* Listing WAFFLE earlier (or first) in your dependency list
* Specifying the most recent version of JNA as a dependency
* If you are using a parent (e.g., Spring Boot) that includes JNA as a dependency, override the `jna.version` property

Expand All @@ -93,12 +93,12 @@ Contributing
* [Set Up a Development Environment](Docs/SettingUpDevelopmentEnvironment.md).
* Make your code changes. Don't forget tests.
* Update [CHANGELOG](CHANGELOG.md).
* Make pull requests. Bonus points for topic branches.
* Make pull requests. Bonus points for topic branches.

License and Copyright
---------------------

Copyright (c) [Application Security Inc.](https://www.trustwave.com/Company/AppSecInc-is-now-Trustwave/), 2010-2020 and Contributors.
Copyright (c) [Application Security Inc.](https://www.trustwave.com/Company/AppSecInc-is-now-Trustwave/), 2010-2020 and Contributors.

This project is licensed under the [MIT License](https://github.com/Waffle/waffle/blob/master/LICENSE).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ void testInitBasicSecurityFilterProvider() throws ServletException {
filterConfig.setParameter("waffle.servlet.spi.BasicSecurityFilterProvider/realm", "DemoRealm");
filterConfig.setParameter("authProvider", MockWindowsAuthProvider.class.getName());
this.filter.init(filterConfig);
Assertions.assertEquals(this.filter.getPrincipalFormat(), PrincipalFormat.SID);
Assertions.assertEquals(this.filter.getRoleFormat(), PrincipalFormat.NONE);
Assertions.assertEquals(PrincipalFormat.SID, this.filter.getPrincipalFormat());
Assertions.assertEquals(PrincipalFormat.NONE, this.filter.getRoleFormat());
Assertions.assertTrue(this.filter.isAllowGuestLogin());
Assertions.assertEquals(1, this.filter.getProviders().size());
Assertions.assertTrue(this.filter.getAuth() instanceof MockWindowsAuthProvider);
Expand Down Expand Up @@ -372,8 +372,8 @@ void testInitNegotiateSecurityFilterProvider() throws ServletException {
filterConfig.setParameter("waffle.servlet.spi.NegotiateSecurityFilterProvider/protocols",
"NTLM\nNegotiate NTLM");
this.filter.init(filterConfig);
Assertions.assertEquals(this.filter.getPrincipalFormat(), PrincipalFormat.FQN);
Assertions.assertEquals(this.filter.getRoleFormat(), PrincipalFormat.FQN);
Assertions.assertEquals(PrincipalFormat.FQN, this.filter.getPrincipalFormat());
Assertions.assertEquals(PrincipalFormat.FQN, this.filter.getRoleFormat());
Assertions.assertTrue(this.filter.isAllowGuestLogin());
Assertions.assertEquals(1, this.filter.getProviders().size());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2010-2022 The Waffle Project Contributors: https://github.com/Waffle/waffle/graphs/contributors
* Copyright (c) 2010-2024 The Waffle Project Contributors: https://github.com/Waffle/waffle/graphs/contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -25,8 +25,6 @@

import com.sun.jna.Platform;

import jakarta.servlet.ServletException;

import java.io.IOException;
import java.io.StringReader;

Expand Down Expand Up @@ -63,11 +61,9 @@ class WaffleInfoServletTest {
* the SAX exception
* @throws IOException
* Signals that an I/O exception has occurred.
* @throws ServletException
* the servlet exception
*/
@Test
void testGetInfo() throws ParserConfigurationException, SAXException, IOException, ServletException {
void testGetInfo() throws ParserConfigurationException, SAXException, IOException {
final SimpleHttpRequest request = new SimpleHttpRequest();
request.addHeader("hello", "waffle");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
*/
package waffle.windows.auth;

import jakarta.servlet.ServletException;

import java.io.IOException;

import org.junit.jupiter.api.Test;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Scope;
Expand Down Expand Up @@ -64,14 +60,9 @@ public static class St {

/**
* Benchmark.
*
* @throws IOException
* Signals that an I/O exception has occurred.
* @throws ServletException
* the servlet exception
*/
@Benchmark
public void benchmark() throws IOException, ServletException {
public void benchmark() {
this.tests.testAcceptSecurityToken();
}

Expand Down

0 comments on commit cdf151b

Please sign in to comment.