congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
KeyValue.equals
Code IndexAdd Tabnine to your IDE (free)

How to use
equals
method
in
org.apache.sentry.policy.common.KeyValue

Best Java code snippets using org.apache.sentry.policy.common.KeyValue.equals (Showing top 6 results out of 315)

origin: apache/incubator-sentry

private boolean impliesKeyValue(KeyValue policyPart, KeyValue requestPart) {
 Preconditions.checkState(policyPart.getKey().equalsIgnoreCase(requestPart.getKey()),
   "Please report, this method should not be called with two different keys");
 if(policyPart.getValue().equals(IndexerConstants.ALL) || policyPart.equals(requestPart)) {
  return true;
 } else if (!PolicyConstants.PRIVILEGE_NAME.equalsIgnoreCase(policyPart.getKey())
   && IndexerConstants.ALL.equalsIgnoreCase(requestPart.getValue())) {
  /* privilege request is to match with any object of given type */
  return true;
 }
 return false;
}
origin: apache/incubator-sentry

private boolean impliesKeyValue(KeyValue policyPart, KeyValue requestPart) {
 Preconditions.checkState(policyPart.getKey().equalsIgnoreCase(requestPart.getKey()),
   "Please report, this method should not be called with two different keys");
 if(policyPart.getValue().equals(SearchConstants.ALL) || policyPart.equals(requestPart)) {
  return true;
 } else if (!PolicyConstants.PRIVILEGE_NAME.equalsIgnoreCase(policyPart.getKey())
   && SearchConstants.ALL.equalsIgnoreCase(requestPart.getValue())) {
  /* privilege request is to match with any object of given type */
  return true;
 }
 return false;
}
origin: apache/incubator-sentry

 private boolean impliesKeyValue(KeyValue policyPart, KeyValue requestPart) {
  Preconditions.checkState(policyPart.getKey().equalsIgnoreCase(requestPart.getKey()),
    "Please report, this method should not be called with two different keys");
  if(policyPart.getValue().equalsIgnoreCase(SqoopActionConstant.ALL) ||
    policyPart.getValue().equalsIgnoreCase(SqoopActionConstant.ALL_NAME) ||
    policyPart.equals(requestPart)) {
   return true;
  } else if (!SqoopActionConstant.NAME.equalsIgnoreCase(policyPart.getKey())
    && SqoopActionConstant.ALL.equalsIgnoreCase(requestPart.getValue())) {
   /* privilege request is to match with any object of given type */
   return true;
  }
  return false;

 }
}
origin: apache/incubator-sentry

private boolean impliesKeyValue(KeyValue policyPart, KeyValue requestPart) {
 Preconditions.checkState(policyPart.getKey().equalsIgnoreCase(requestPart.getKey()),
   "Please report, this method should not be called with two different keys");
 // Host is a special resource, not declared as resource in Kafka. Each Kafka resource can be
 // authorized based on the host request originated from and to handle this, Sentry uses host as
 // a resource. Kafka allows using '*' as wildcard for all hosts. '*' however is not a valid
 // Kafka action.
 if (hasHostWidCard(policyPart)) {
  return true;
 }
 if (KafkaActionConstant.actionName.equalsIgnoreCase(policyPart.getKey())) { // is action
  return policyPart.getValue().equalsIgnoreCase(KafkaActionConstant.ALL) ||
    policyPart.equals(requestPart);
 } else {
  return policyPart.getValue().equals(requestPart.getValue());
 }
}
origin: co.cask.cdap/cdap-sentry-policy

 /**
  * For policy and request parts with the same key, ensure that the policy implies the request. In this method, the
  * keys for both #policyPart and #requestPart are expected to be the same.
  *
  * @param policyPart the policy part
  * @param requestPart the request part
  * @return true if either
  * - policy part is {@link Action#ALL}; or
  * - policy part equals request part;
  * false otherwise.
  */
 private boolean impliesKeyValue(KeyValue policyPart, KeyValue requestPart) {
  Preconditions.checkState(policyPart.getKey().equalsIgnoreCase(requestPart.getKey()),
               String.format("Privilege Key Mismatch: Key %s and %s does not match.", policyPart.getKey
                (), requestPart.getKey()));
  // if it is an action, then either the policy part must include ALL, or be the same as the request part.
  if (ActionConstant.ACTION_NAME.equalsIgnoreCase(policyPart.getKey()) &&
   policyPart.getValue().equalsIgnoreCase(ActionConstant.ALL)) {
    return true;
  }
  // if policy part is not Action#ALL, make sure that the policy and request parts match.
  return policyPart.equals(requestPart);
 }
}
origin: apache/incubator-sentry

private boolean impliesKeyValue(KeyValue policyPart, KeyValue requestPart) {
 Preconditions.checkState(policyPart.getKey().equalsIgnoreCase(requestPart.getKey()),
   "Please report, this method should not be called with two different keys");
 if(policyPart.getValue().equals(AccessConstants.ALL) ||
   policyPart.getValue().equalsIgnoreCase("ALL")) {
  return true;
 } else if (!PolicyConstants.PRIVILEGE_NAME.equalsIgnoreCase(policyPart.getKey())
   && AccessConstants.ALL.equalsIgnoreCase(requestPart.getValue())) {
  /* privilege request is to match with any object of given type */
  return true;
 } else if (!PolicyConstants.PRIVILEGE_NAME.equalsIgnoreCase(policyPart.getKey())
   && AccessConstants.SOME.equalsIgnoreCase(requestPart.getValue())) {
  /* privilege request is to match with any object of given type */
  return true;
 } else if(policyPart.getKey().equalsIgnoreCase(AuthorizableType.URI.name())) {
  return impliesURI(policyPart.getValue(), requestPart.getValue());
 }
 return policyPart.equals(requestPart);
}
org.apache.sentry.policy.commonKeyValueequals

Popular methods of KeyValue

  • <init>
  • getKey
  • getValue

Popular in Java

  • Reactive rest calls using spring rest template
  • getContentResolver (Context)
  • requestLocationUpdates (LocationManager)
  • runOnUiThread (Activity)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now