Class DefaultRestAuthenticationConfig

java.lang.Object
org.apache.unomi.rest.authentication.impl.DefaultRestAuthenticationConfig
All Implemented Interfaces:
RestAuthenticationConfig

public class DefaultRestAuthenticationConfig extends Object implements RestAuthenticationConfig
Default implementation for the unomi authentication on Rest endpoints
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Define the global roles required for accessing endpoints methods, in case the method doesnt have specific required roles It will fallback on this global roles
    This is the roles mapped to endpoints By default all methods are protected by the global roles But you can define more granularity by providing roles for given endpoint methods Multiple format supported for the keys: - Method precise signature: org.apache.unomi.api.ContextResponse getContextJSON(java.lang.Stringjava.lang.Longjava.lang.String) - Class name + method name: org.apache.unomi.rest.ContextJsonEndpoint.getContextJSON - Method name only: getContextJSON
    This provide the patterns to identify public endpoints The patterns will be tested against this format: "HTTP_METHOD HTTP_PATH_WITHOUT_CXS_PREFIX", like: "GET context.json" sample pattern for identify GET, POST and OPTIONS on "/cxs/context.json" as public requests would be: "(GET|POST|OPTIONS) context\\.json" sample pattern for identify GET only on all paths starting by "/cxs/client/" as public requests would be: "GET client/

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultRestAuthenticationConfig

      public DefaultRestAuthenticationConfig()
  • Method Details

    • getPublicPathPatterns

      public List<Pattern> getPublicPathPatterns()
      Description copied from interface: RestAuthenticationConfig
      This provide the patterns to identify public endpoints The patterns will be tested against this format: "HTTP_METHOD HTTP_PATH_WITHOUT_CXS_PREFIX", like: "GET context.json" sample pattern for identify GET, POST and OPTIONS on "/cxs/context.json" as public requests would be: "(GET|POST|OPTIONS) context\\.json" sample pattern for identify GET only on all paths starting by "/cxs/client/" as public requests would be: "GET client/.*"
      Specified by:
      getPublicPathPatterns in interface RestAuthenticationConfig
      Returns:
      the list of public paths patterns
    • getMethodRolesMap

      public Map<String,String> getMethodRolesMap()
      Description copied from interface: RestAuthenticationConfig
      This is the roles mapped to endpoints By default all methods are protected by the global roles But you can define more granularity by providing roles for given endpoint methods Multiple format supported for the keys: - Method precise signature: org.apache.unomi.api.ContextResponse getContextJSON(java.lang.Stringjava.lang.Longjava.lang.String) - Class name + method name: org.apache.unomi.rest.ContextJsonEndpoint.getContextJSON - Method name only: getContextJSON
      Specified by:
      getMethodRolesMap in interface RestAuthenticationConfig
      Returns:
      the list of role mappings <methodKey, roles separated by single white spaces>, like: <"getContextJSON", "ROLE1 ROLE2 ROLE3">
    • getGlobalRoles

      public String getGlobalRoles()
      Description copied from interface: RestAuthenticationConfig
      Define the global roles required for accessing endpoints methods, in case the method doesnt have specific required roles It will fallback on this global roles
      Specified by:
      getGlobalRoles in interface RestAuthenticationConfig
      Returns:
      Global roles separated with single white spaces, like: "ROLE1 ROLE2 ROLE3"