Class BlueMindAclClient

java.lang.Object
org.exoplatform.bluemind.calendar.service.BlueMindAclClient

@Component @ConditionalOnClass({org.exoplatform.caldav.client.CalDavEndpoint.class,org.exoplatform.caldav.plugin.CalendarShareChannel.class}) public class BlueMindAclClient extends Object
Reads the access control list of a BlueMind calendar through BlueMind's own REST API — the one place its sharing state can be read (EXO-90253).

BlueMind's DAV server answers a CS:share with 200 whatever it did and publishes no sharee list over DAV (CS:invite is a stub: plugins/net.bluemind.dav.server/.../proto/props/calendarserver/Invite.java), so the only proof that a grant was applied is the container's access list, GET /api/containers/_manage/{containerUid}/_acl (parent/core/net.bluemind.core.container.api/.../IContainerManagement.java), which the container's owner may read (ContainerPermissionResolver.java: the owner holds every verb).

The session — same server, the owner's stored credentials, a session reused while it is kept, never sent anywhere else — is BlueMindCalendarSessions's, shared with every other REST conversation the calendar contributions hold with BlueMind.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The header BlueMind's REST API reads a session key from.
  • Constructor Summary

    Constructors
    Constructor
    Description
    The client Spring builds, over the shared sessions.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    acceptsCredentials(org.exoplatform.caldav.client.CalDavEndpoint endpoint)
    Whether the owner's configured credentials are a login and password this API can take, without calling the server: what decides whether sharing on BlueMind is offered at all, so that a registration whose provider produces a token never shows an action every click of which would be refused.
    open(org.exoplatform.caldav.client.CalDavEndpoint endpoint)
    Opens a REST session as the owner, for as many reads as one operation needs — a grant or a revoke reads the list before the change and after it — so that they share one session instead of one each.
    readAcl(org.exoplatform.caldav.client.CalDavEndpoint endpoint, String containerUid)
    A container's access list, read as its owner in a REST session of its own.

    Methods inherited from class java.lang.Object

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

    • API_KEY_HEADER

      public static final String API_KEY_HEADER
      The header BlueMind's REST API reads a session key from.
      See Also:
  • Constructor Details

    • BlueMindAclClient

      @Autowired public BlueMindAclClient(BlueMindCalendarSessions session)
      The client Spring builds, over the shared sessions.
      Parameters:
      session - the sessions every calendar conversation with BlueMind shares
  • Method Details

    • readAcl

      public List<BlueMindAce> readAcl(org.exoplatform.caldav.client.CalDavEndpoint endpoint, String containerUid)
      A container's access list, read as its owner in a REST session of its own.
      Parameters:
      endpoint - the owner's DAV endpoint, minted from the registry
      containerUid - the container uid, the last segment of the calendar collection's path
      Returns:
      the entries, in the order BlueMind lists them
      Throws:
      UnsupportedOperationException - when the configured credentials are not a login and password
      org.exoplatform.caldav.client.CalDavAuthenticationException - when BlueMind refuses the login
      org.exoplatform.caldav.client.CalDavForbiddenException - when the account may not read the list
      org.exoplatform.caldav.client.CalDavUnreachableException - when the server cannot be reached
      org.exoplatform.caldav.client.CalDavException - when the answer is anything else
    • open

      public BlueMindAclSession open(org.exoplatform.caldav.client.CalDavEndpoint endpoint)
      Opens a REST session as the owner, for as many reads as one operation needs — a grant or a revoke reads the list before the change and after it — so that they share one session instead of one each. BlueMindAclSession.close() logs out a session nothing keeps. The exceptions are those of readAcl(CalDavEndpoint, String) for the login half.
      Parameters:
      endpoint - the owner's DAV endpoint, minted from the registry
      Returns:
      the session, to close
    • acceptsCredentials

      public boolean acceptsCredentials(org.exoplatform.caldav.client.CalDavEndpoint endpoint)
      Whether the owner's configured credentials are a login and password this API can take, without calling the server: what decides whether sharing on BlueMind is offered at all, so that a registration whose provider produces a token never shows an action every click of which would be refused.
      Parameters:
      endpoint - the owner's endpoint, minted from the registry
      Returns:
      true when the provider produces a Basic login and password