ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/catalina/authenticator/jaspic/SimpleAuthConfigProvider.java

Path
ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/catalina/authenticator/jaspic/SimpleAuthConfigProvider.java
Status
scanned
Type
file
Name
SimpleAuthConfigProvider.java
Extension
.java
Programming language
Java
Mime type
text/plain
File type
ASCII text, with CRLF line terminators
Tag

      
    
Rootfs path

      
    
Size
3374 (3.3 KB)
MD5
c286b7764efa246b1f2f9e744d9c0a01
SHA1
cc0a64186727145b570d7d1653d4540edb93c7b7
SHA256
056a34308aea9a78ebd12a389f2298c2f438740d8d9a0cee141b7819172d808a
SHA512

      
    
SHA1_git
dd2d662cda080e5ccfa859c4144dd148676bf2de
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
SimpleAuthConfigProvider.java | 3.3 KB |

/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.catalina.authenticator.jaspic; import java.util.Map; import javax.security.auth.callback.CallbackHandler; import jakarta.security.auth.message.AuthException; import jakarta.security.auth.message.config.AuthConfigFactory; import jakarta.security.auth.message.config.AuthConfigProvider; import jakarta.security.auth.message.config.ClientAuthConfig; import jakarta.security.auth.message.config.ServerAuthConfig; /** * Basic implementation primarily intended for use when using third-party * {@link jakarta.security.auth.message.module.ServerAuthModule} implementations that only provide the module. */ public class SimpleAuthConfigProvider implements AuthConfigProvider { private final Map<String,Object> properties; private volatile ServerAuthConfig serverAuthConfig; public SimpleAuthConfigProvider(Map<String,Object> properties, AuthConfigFactory factory) { this.properties = properties; if (factory != null) { factory.registerConfigProvider(this, null, null, "Automatic registration"); } } /** * {@inheritDoc} * <p> * This implementation does not support client-side authentication and therefore always returns {@code null}. */ @Override public ClientAuthConfig getClientAuthConfig(String layer, String appContext, CallbackHandler handler) throws AuthException { return null; } @Override public ServerAuthConfig getServerAuthConfig(String layer, String appContext, CallbackHandler handler) throws AuthException { ServerAuthConfig serverAuthConfig = this.serverAuthConfig; if (serverAuthConfig == null) { synchronized (this) { if (this.serverAuthConfig == null) { this.serverAuthConfig = createServerAuthConfig(layer, appContext, handler, properties); } serverAuthConfig = this.serverAuthConfig; } } return serverAuthConfig; } protected ServerAuthConfig createServerAuthConfig(String layer, String appContext, CallbackHandler handler, Map<String,Object> properties) { return new SimpleServerAuthConfig(layer, appContext, handler, properties); } @Override public void refresh() { ServerAuthConfig serverAuthConfig = this.serverAuthConfig; if (serverAuthConfig != null) { serverAuthConfig.refresh(); } } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
36.62
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-4bde3f57-78aa-4201-96bf-531cba09e7de apache-2.0 Apache-2.0
URL Start line End line
http://www.apache.org/licenses/LICENSE-2.0 9 9