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

com.datahub.authentication.AuthenticationRequest Maven / Gradle / Ivy

Go to download

DataHub Auth API for developers to write custom Authentication & Authorization plugins for DataHub

There is a newer version: 0.14.1-12rc1
Show newest version
package com.datahub.authentication;

import com.datahub.plugins.auth.authentication.Authenticator;
import java.util.Map;
import java.util.Objects;
import java.util.TreeMap;
import javax.annotation.Nonnull;
import lombok.Getter;

/**
 * Request context provided to each {@link Authenticator} to perform Authentication.
 *
 * 

Currently, this class only hold the inbound request's headers, but could certainly be extended * to contain additional information like the request parameters, body, ip, etc as needed. */ @Getter public class AuthenticationRequest { private final Map caseInsensitiveHeaders; private final String servletInfo; private final String pathInfo; public AuthenticationRequest(@Nonnull final Map requestHeaders) { this("", "", requestHeaders); } public AuthenticationRequest( @Nonnull String servletInfo, @Nonnull String pathInfo, @Nonnull final Map requestHeaders) { Objects.requireNonNull(requestHeaders); caseInsensitiveHeaders = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); caseInsensitiveHeaders.putAll(requestHeaders); this.servletInfo = servletInfo; this.pathInfo = pathInfo; } /** * @return Returns a case-insensitive map of the inbound request's headers. */ @Nonnull public Map getRequestHeaders() { return this.caseInsensitiveHeaders; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy