Class AuthEnv


  • public class AuthEnv
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.slf4j.Logger LOG  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.net.http.HttpRequest.Builder addAuth​(java.net.http.HttpRequest.Builder requestBuilder, java.lang.String uri)
      Add authentication, if in the authModifiers registry.
      void clearActiveAuthentication()  
      void clearAuthEnv()
      Clear all registrations.
      static AuthEnv get()  
      PasswordRecord getUsernamePassword​(java.net.URI uri)
      Return the (username, password) for a URI.
      boolean hasRegistation​(java.net.URI uri)
      Check whether there is a registration.
      void registerBasicAuthModifier​(java.lang.String url, java.lang.String user, java.lang.String password)
      Register the users/password which is to be used with basic auth at the given URL
      void registerUsernamePassword​(java.net.URI uri, java.lang.String user, java.lang.String password)
      Register (username, password) information for a URI endpoint.
      void unregisterUsernamePassword​(java.net.URI uri)
      Register (username, password) information for a URI endpoint.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOG

        public static org.slf4j.Logger LOG
    • Method Detail

      • get

        public static AuthEnv get()
      • registerUsernamePassword

        public void registerUsernamePassword​(java.net.URI uri,
                                             java.lang.String user,
                                             java.lang.String password)
        Register (username, password) information for a URI endpoint.
      • hasRegistation

        public boolean hasRegistation​(java.net.URI uri)
        Check whether there is a registration.
      • unregisterUsernamePassword

        public void unregisterUsernamePassword​(java.net.URI uri)
        Register (username, password) information for a URI endpoint.
      • getUsernamePassword

        public PasswordRecord getUsernamePassword​(java.net.URI uri)
        Return the (username, password) for a URI.

        If there is no exact match for the URI, then the information mapped from the longest prefix entry is returned.

      • clearActiveAuthentication

        public void clearActiveAuthentication()
      • clearAuthEnv

        public void clearAuthEnv()
        Clear all registrations.
      • addAuth

        public java.net.http.HttpRequest.Builder addAuth​(java.net.http.HttpRequest.Builder requestBuilder,
                                                         java.lang.String uri)
        Add authentication, if in the authModifiers registry. That is, add the right headers, and for digest, calculate the new digest string.
      • registerBasicAuthModifier

        public void registerBasicAuthModifier​(java.lang.String url,
                                              java.lang.String user,
                                              java.lang.String password)
        Register the users/password which is to be used with basic auth at the given URL