All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.camel.component.netty.http.NettyHttpSecurityConfiguration Maven / Gradle / Ivy

There is a newer version: 4.9.0
Show newest version
/**
 * 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.camel.component.netty.http;

import org.apache.camel.LoggingLevel;

/**
 * Security configuration for the {@link NettyHttpConsumer}.
 */
public class NettyHttpSecurityConfiguration {

    private boolean authenticate = true;
    private String constraint = "Basic";
    private String realm;
    private SecurityConstraint securityConstraint;
    private SecurityAuthenticator securityAuthenticator;
    private LoggingLevel loginDeniedLoggingLevel = LoggingLevel.DEBUG;
    private String roleClassName;

    public boolean isAuthenticate() {
        return authenticate;
    }

    /**
     * Whether to enable authentication
     * 

* This is by default enabled. */ public void setAuthenticate(boolean authenticate) { this.authenticate = authenticate; } public String getConstraint() { return constraint; } /** * The supported restricted. *

* Currently only Basic is supported. */ public void setConstraint(String constraint) { this.constraint = constraint; } public String getRealm() { return realm; } /** * Sets the name of the realm to use. */ public void setRealm(String realm) { this.realm = realm; } public SecurityConstraint getSecurityConstraint() { return securityConstraint; } /** * Sets a {@link SecurityConstraint} to use for checking if a web resource is restricted or not *

* By default this is null, which means all resources is restricted. */ public void setSecurityConstraint(SecurityConstraint securityConstraint) { this.securityConstraint = securityConstraint; } public SecurityAuthenticator getSecurityAuthenticator() { return securityAuthenticator; } /** * Sets the {@link SecurityAuthenticator} to use for authenticating the {@link HttpPrincipal}. */ public void setSecurityAuthenticator(SecurityAuthenticator securityAuthenticator) { this.securityAuthenticator = securityAuthenticator; } public LoggingLevel getLoginDeniedLoggingLevel() { return loginDeniedLoggingLevel; } /** * Sets a logging level to use for logging denied login attempts (incl stacktraces) *

* This level is by default DEBUG. */ public void setLoginDeniedLoggingLevel(LoggingLevel loginDeniedLoggingLevel) { this.loginDeniedLoggingLevel = loginDeniedLoggingLevel; } public String getRoleClassName() { return roleClassName; } public void setRoleClassName(String roleClassName) { this.roleClassName = roleClassName; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy