public class org.apache.hive.service.auth.saml.HiveSamlRelayStateStore extends java.lang.Object implements org.pac4j.core.util.generator.ValueGenerator
{
private static final org.slf4j.Logger LOG;
private final com.google.common.cache.Cache relayStateCache;
private static final org.apache.hive.service.auth.saml.HiveSamlRelayStateStore INSTANCE;
private void <init>()
{
java.util.concurrent.TimeUnit v;
org.apache.hive.service.auth.saml.HiveSamlRelayStateStore v;
com.google.common.cache.CacheBuilder v, v;
com.google.common.cache.Cache v;
v := @this: org.apache.hive.service.auth.saml.HiveSamlRelayStateStore;
specialinvoke v.<java.lang.Object: void <init>()>();
v = staticinvoke <com.google.common.cache.CacheBuilder: com.google.common.cache.CacheBuilder newBuilder()>();
v = <java.util.concurrent.TimeUnit: java.util.concurrent.TimeUnit MINUTES>;
v = virtualinvoke v.<com.google.common.cache.CacheBuilder: com.google.common.cache.CacheBuilder expireAfterWrite(long,java.util.concurrent.TimeUnit)>(5L, v);
v = virtualinvoke v.<com.google.common.cache.CacheBuilder: com.google.common.cache.Cache build()>();
v.<org.apache.hive.service.auth.saml.HiveSamlRelayStateStore: com.google.common.cache.Cache relayStateCache> = v;
return;
}
public static org.apache.hive.service.auth.saml.HiveSamlRelayStateStore get()
{
org.apache.hive.service.auth.saml.HiveSamlRelayStateStore v;
v = <org.apache.hive.service.auth.saml.HiveSamlRelayStateStore: org.apache.hive.service.auth.saml.HiveSamlRelayStateStore INSTANCE>;
return v;
}
public java.lang.String generateValue(org.pac4j.core.context.WebContext)
{
org.apache.hive.service.auth.saml.HiveSamlRelayStateStore v;
java.lang.RuntimeException v;
java.util.UUID v, v;
org.apache.hive.service.auth.saml.HiveSamlRelayStateInfo v;
org.pac4j.core.context.WebContext v;
int v;
java.util.Optional v;
java.lang.Object v;
java.lang.String v, v, v;
com.google.common.cache.Cache v;
boolean v;
v := @this: org.apache.hive.service.auth.saml.HiveSamlRelayStateStore;
v := @parameter: org.pac4j.core.context.WebContext;
v = interfaceinvoke v.<org.pac4j.core.context.WebContext: java.util.Optional getRequestHeader(java.lang.String)>("X-Hive-Token-Response-Port");
v = virtualinvoke v.<java.util.Optional: boolean isPresent()>();
if v != 0 goto label;
v = new java.lang.RuntimeException;
specialinvoke v.<java.lang.RuntimeException: void <init>(java.lang.String)>("SAML response port header X-Hive-Token-Response-Port is not set ");
throw v;
label:
v = virtualinvoke v.<java.util.Optional: java.lang.Object get()>();
v = staticinvoke <java.lang.Integer: int parseInt(java.lang.String)>(v);
v = staticinvoke <java.util.UUID: java.util.UUID randomUUID()>();
v = virtualinvoke v.<java.util.UUID: java.lang.String toString()>();
v = new org.apache.hive.service.auth.saml.HiveSamlRelayStateInfo;
v = staticinvoke <java.util.UUID: java.util.UUID randomUUID()>();
v = virtualinvoke v.<java.util.UUID: java.lang.String toString()>();
specialinvoke v.<org.apache.hive.service.auth.saml.HiveSamlRelayStateInfo: void <init>(int,java.lang.String)>(v, v);
v = virtualinvoke v.<org.apache.hive.service.auth.saml.HiveSamlRelayStateInfo: java.lang.String getClientIdentifier()>();
interfaceinvoke v.<org.pac4j.core.context.WebContext: void setResponseHeader(java.lang.String,java.lang.String)>("X-Hive-Client-Identifier", v);
v = v.<org.apache.hive.service.auth.saml.HiveSamlRelayStateStore: com.google.common.cache.Cache relayStateCache>;
interfaceinvoke v.<com.google.common.cache.Cache: void put(java.lang.Object,java.lang.Object)>(v, v);
return v;
}
public java.lang.String getRelayStateInfo(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) throws org.apache.hive.service.auth.saml.HttpSamlAuthenticationException
{
javax.servlet.http.HttpServletRequest v;
org.apache.hive.service.auth.saml.HttpSamlAuthenticationException v;
org.apache.hive.service.auth.saml.HiveSamlRelayStateStore v;
javax.servlet.http.HttpServletResponse v;
java.lang.String v;
v := @this: org.apache.hive.service.auth.saml.HiveSamlRelayStateStore;
v := @parameter: javax.servlet.http.HttpServletRequest;
v := @parameter: javax.servlet.http.HttpServletResponse;
v = interfaceinvoke v.<javax.servlet.http.HttpServletRequest: java.lang.String getParameter(java.lang.String)>("RelayState");
if v != null goto label;
v = new org.apache.hive.service.auth.saml.HttpSamlAuthenticationException;
specialinvoke v.<org.apache.hive.service.auth.saml.HttpSamlAuthenticationException: void <init>(java.lang.String)>("Could not get the RelayState from the SAML response");
throw v;
label:
return v;
}
public org.apache.hive.service.auth.saml.HiveSamlRelayStateInfo getRelayStateInfo(java.lang.String) throws org.apache.hive.service.auth.saml.HttpSamlAuthenticationException
{
org.apache.hive.service.auth.saml.HttpSamlAuthenticationException v;
org.apache.hive.service.auth.saml.HiveSamlRelayStateStore v;
java.lang.Object v;
java.lang.String v, v;
com.google.common.cache.Cache v;
v := @this: org.apache.hive.service.auth.saml.HiveSamlRelayStateStore;
v := @parameter: java.lang.String;
v = v.<org.apache.hive.service.auth.saml.HiveSamlRelayStateStore: com.google.common.cache.Cache relayStateCache>;
v = interfaceinvoke v.<com.google.common.cache.Cache: java.lang.Object getIfPresent(java.lang.Object)>(v);
if v != null goto label;
v = new org.apache.hive.service.auth.saml.HttpSamlAuthenticationException;
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("Invalid value of relay state received: \u0001");
specialinvoke v.<org.apache.hive.service.auth.saml.HttpSamlAuthenticationException: void <init>(java.lang.String)>(v);
throw v;
label:
return v;
}
public synchronized boolean validateClientIdentifier(java.lang.String, java.lang.String)
{
org.slf4j.Logger v;
org.apache.hive.service.auth.saml.HiveSamlRelayStateStore v;
java.lang.Object v;
java.lang.String v, v, v, v, v;
com.google.common.cache.Cache v, v;
boolean v;
v := @this: org.apache.hive.service.auth.saml.HiveSamlRelayStateStore;
v := @parameter: java.lang.String;
v := @parameter: java.lang.String;
v = v.<org.apache.hive.service.auth.saml.HiveSamlRelayStateStore: com.google.common.cache.Cache relayStateCache>;
v = interfaceinvoke v.<com.google.common.cache.Cache: java.lang.Object getIfPresent(java.lang.Object)>(v);
if v != null goto label;
return 0;
label:
v = v.<org.apache.hive.service.auth.saml.HiveSamlRelayStateStore: com.google.common.cache.Cache relayStateCache>;
interfaceinvoke v.<com.google.common.cache.Cache: void invalidate(java.lang.Object)>(v);
v = <org.apache.hive.service.auth.saml.HiveSamlRelayStateStore: org.slf4j.Logger LOG>;
v = virtualinvoke v.<org.apache.hive.service.auth.saml.HiveSamlRelayStateInfo: java.lang.String getClientIdentifier()>();
interfaceinvoke v.<org.slf4j.Logger: void debug(java.lang.String,java.lang.Object,java.lang.Object)>("Validating client identifier {} with {}", v, v);
v = virtualinvoke v.<org.apache.hive.service.auth.saml.HiveSamlRelayStateInfo: java.lang.String getClientIdentifier()>();
v = staticinvoke <java.lang.String: java.lang.String valueOf(java.lang.Object)>(v);
v = virtualinvoke v.<java.lang.String: boolean equals(java.lang.Object)>(v);
return v;
}
static void <clinit>()
{
org.slf4j.Logger v;
org.apache.hive.service.auth.saml.HiveSamlRelayStateStore v;
v = staticinvoke <org.slf4j.LoggerFactory: org.slf4j.Logger getLogger(java.lang.Class)>(class "Lorg/apache/hive/service/auth/saml/HiveSamlRelayStateStore;");
<org.apache.hive.service.auth.saml.HiveSamlRelayStateStore: org.slf4j.Logger LOG> = v;
v = new org.apache.hive.service.auth.saml.HiveSamlRelayStateStore;
specialinvoke v.<org.apache.hive.service.auth.saml.HiveSamlRelayStateStore: void <init>()>();
<org.apache.hive.service.auth.saml.HiveSamlRelayStateStore: org.apache.hive.service.auth.saml.HiveSamlRelayStateStore INSTANCE> = v;
return;
}
}