Github user janhoy commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/458#discussion_r240523872
  
    --- Diff: solr/core/src/java/org/apache/solr/security/BasicAuthPlugin.java 
---
    @@ -181,7 +217,54 @@ public boolean getBlockUnknown(){
       }
     
       public static final String BLOCK_UNKNOWN = "blockUnknown";
    -  private static final Set<String> PROPS = ImmutableSet.of(BLOCK_UNKNOWN);
    +  public static final String FORWARD_CREDENTIALS = "forwardCredentials";
    +  private static final Set<String> PROPS = ImmutableSet.of(BLOCK_UNKNOWN, 
FORWARD_CREDENTIALS);
    +
    +  
    +  @Contract(threading = ThreadingBehavior.IMMUTABLE)
    +  private class BasicAuthUserPrincipal implements Principal, Serializable {
    +    private String username;
    +    private final String password;
    +
    +    public BasicAuthUserPrincipal(String username, String pwd) {
    +      this.username = username;
    +      this.password = pwd;
    +    }
     
    +    @Override
    +    public String getName() {
    +        return this.username;
    +    }
    +
    +    public String getPassword() {
    +      return password;
    +    }
     
    +    @Override
    +    public boolean implies(Subject subject) {
    +      return false;
    +    }
    +
    +    @Override
    +    public boolean equals(Object o) {
    +      if (this == o) return true;
    +      if (o == null || getClass() != o.getClass()) return false;
    +      BasicAuthUserPrincipal that = (BasicAuthUserPrincipal) o;
    +      return Objects.equals(username, that.username) &&
    +          Objects.equals(password, that.password);
    +    }
    +
    +    @Override
    +    public int hashCode() {
    +      return Objects.hash(username, password);
    +    }
    +
    +    @Override
    +    public String toString() {
    +      return new ToStringBuilder(this)
    +          .append("username", username)
    +          .append("pwd", password)
    --- End diff --
    
    Redacted password with `*****`


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to