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

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

      
    
Rootfs path

      
    
Size
2813 (2.7 KB)
MD5
7163049f87002c680990911fb7ddbcc3
SHA1
985431d8026740d8c867c01cf069c03f07167d95
SHA256
7ff3382bd9afa5b6a1d3748fdbf6e3d524a2023a36424910e8573507a3e4b181
SHA512

      
    
SHA1_git
0f2eab9e6636a128b7c5e6aed60bd7a656f9168f
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
MessageInfoImpl.java | 2.7 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.HashMap; import java.util.Map; import jakarta.security.auth.message.MessageInfo; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import org.apache.tomcat.util.res.StringManager; public class MessageInfoImpl implements MessageInfo { protected static final StringManager sm = StringManager.getManager(MessageInfoImpl.class); public static final String IS_MANDATORY = "jakarta.security.auth.message.MessagePolicy.isMandatory"; private final Map<String,Object> map = new HashMap<>(); private HttpServletRequest request; private HttpServletResponse response; public MessageInfoImpl() { } public MessageInfoImpl(HttpServletRequest request, HttpServletResponse response, boolean authMandatory) { this.request = request; this.response = response; map.put(IS_MANDATORY, Boolean.toString(authMandatory)); } @Override public Map<String,Object> getMap() { return map; } @Override public Object getRequestMessage() { return request; } @Override public Object getResponseMessage() { return response; } @Override public void setRequestMessage(Object request) { if (!(request instanceof HttpServletRequest)) { throw new IllegalArgumentException( sm.getString("authenticator.jaspic.badRequestType", request.getClass().getName())); } this.request = (HttpServletRequest) request; } @Override public void setResponseMessage(Object response) { if (!(response instanceof HttpServletResponse)) { throw new IllegalArgumentException( sm.getString("authenticator.jaspic.badResponseType", response.getClass().getName())); } this.response = (HttpServletResponse) response; } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
41.46
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