View Javadoc
1   /*
2    * MIT License
3    *
4    * Copyright (c) 2010-2024 The Waffle Project Contributors: https://github.com/Waffle/waffle/graphs/contributors
5    *
6    * Permission is hereby granted, free of charge, to any person obtaining a copy
7    * of this software and associated documentation files (the "Software"), to deal
8    * in the Software without restriction, including without limitation the rights
9    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10   * copies of the Software, and to permit persons to whom the Software is
11   * furnished to do so, subject to the following conditions:
12   *
13   * The above copyright notice and this permission notice shall be included in all
14   * copies or substantial portions of the Software.
15   *
16   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22   * SOFTWARE.
23   */
24  package waffle.apache;
25  
26  import com.google.errorprone.annotations.InlineMe;
27  
28  import java.security.Principal;
29  
30  import org.apache.catalina.realm.RealmBase;
31  
32  /**
33   * A rudimentary Windows realm.
34   */
35  public class WindowsRealm extends RealmBase {
36  
37      /** The Constant NAME. */
38      protected static final String NAME = "waffle.apache.WindowsRealm/1.0";
39  
40      /**
41       * Gets the name.
42       * <p>
43       * 'waffle.apache.WindowsRealm/1.0' will no longer be logged. We don't internally use this so we must go with
44       * standard java way that tomcat has accepted. This means, going to tomcat 9.0.0.M15+ will result simply in
45       * 'WaffleRealm' or better stated the actual simple class name. Simple class name strips off the package name which
46       * is what we were applying along with version 1.0 which is inaccurate based on our release version.
47       *
48       * @return a short name for this Realm implementation, for use in log messages.
49       *
50       * @deprecated This will be removed in Tomcat 9 onwards. Use {@link Class#getSimpleName()} instead.
51       */
52      @Deprecated
53      @InlineMe(replacement = "WindowsRealm.NAME", imports = "waffle.apache.WindowsRealm")
54      protected final String getName() {
55          return WindowsRealm.NAME;
56      }
57  
58      @Override
59      protected String getPassword(final String value) {
60          return null;
61      }
62  
63      @Override
64      protected Principal getPrincipal(final String value) {
65          return null;
66      }
67  
68  }