Class BrowserSessionBoundary

java.lang.Object
io.fluxzero.idp.bff.session.BrowserSessionBoundary

public final class BrowserSessionBoundary extends Object
Cookie/CSRF policy shared by application BFFs; it never establishes identity or authorization.
  • Constructor Details

    • BrowserSessionBoundary

      public BrowserSessionBoundary(URI origin, String application, boolean loopbackDevelopment)
      HTTP is permitted only by an explicit local-development flag and a loopback or .localhost host.
    • BrowserSessionBoundary

      public BrowserSessionBoundary(URI origin, String application, boolean loopbackDevelopment, Set<URI> frontendOrigins)
      Explicit additional browser origins, for a frontend and API on separate same-site hosts.
  • Method Details

    • origin

      public String origin()
    • cookieName

      public String cookieName()
    • setCookie

      public String setCookie(BrowserHandle handle, Duration lifetime)
    • clearCookie

      public String clearCookie()
    • readCookie

      public Optional<BrowserHandle> readCookie(List<String> cookieHeaders)
      Duplicate or malformed cookie values are rejected, not resolved by first/last-header precedence.
    • permitsMutation

      public boolean permitsMutation(String method, List<String> origins, List<String> csrfHeaders, BrowserHandle expectedCsrf, String fetchSite)
      A synchronizer token is generated independently and retained in the protected session payload.
    • permitsSocket

      public boolean permitsSocket(List<String> origins, String fetchSite)
      Browsers send Origin on WebSocket handshakes; the proxy retains it for later frames.
    • returnPath

      public static String returnPath(String requested)
      Preserves local router paths, query and fragment, without ambiguous/external redirect targets.