@manta-eu/horns-server/session
Reference for @manta-eu/horns-server/session in @manta-eu/horns-server 0.2.3.
Type Aliases
MantaSessionState
MantaSessionState =
object
Properties
upstreamCookies
upstreamCookies:
Record<string,string>
Variables
agentsJwtCookieName
constagentsJwtCookieName:"auth"="auth"
badSessionCookiePrefixMessage
constbadSessionCookiePrefixMessage:"HORNS_SESSION_COOKIE_PREFIX is not a cookie name — use RFC 6265 token characters."= “HORNS_SESSION_COOKIE_PREFIX is not a cookie name \u2014 use RFC 6265 token characters.”
maxSessionCookieChunks
constmaxSessionCookieChunks:8=8
sessionCookiePrefix
constsessionCookiePrefix:"mh_session"="mh_session"
What Horns names its own session cookies. A host with a session of its own overrides it; see sessionCookiePrefixOf.
Functions
captureUpstreamCookies()
captureUpstreamCookies(
state,response,now?):MantaSessionState
Parameters
state
response
Response
now?
number
Returns
clearSessionSetCookies()
clearSessionSetCookies(
attributes,prefix?):string[]
Parameters
attributes
CookieAttributes
prefix?
string
Returns
string[]
isForwardableCookie()
isForwardableCookie(
name,value):boolean
Parameters
name
string
value
string
Returns
boolean
isSignedIn()
isSignedIn(
state):boolean
Parameters
state
MantaSessionState | undefined
Returns
boolean
parseCookieHeader()
parseCookieHeader(
header):Record<string,string>
Parameters
header
string | null | undefined
Returns
Record<string, string>
readSessionState()
readSessionState(
cookieHeader,prefix?):MantaSessionState|undefined
Parameters
cookieHeader
string | null | undefined
prefix?
string
Returns
MantaSessionState | undefined
requestIsSecure()
requestIsSecure(
requestUrl):boolean
Parameters
requestUrl
string
Returns
boolean
serializeCookie()
serializeCookie(
name,value,attributes):string
Parameters
name
string
value
string
attributes
CookieAttributes
Returns
string
sessionCookiePrefixOf()
sessionCookiePrefixOf(
env):string
Which cookies these routes read and write. A host that signs people in itself names its own prefix, or the worker looks for a Horns session the host never wrote and answers every call “not signed in”.
Parameters
env
HORNS_SESSION_COOKIE_PREFIX?
string
Returns
string
sessionsDiffer()
sessionsDiffer(
before,after):boolean
Parameters
before
after
Returns
boolean
sessionSetCookies()
sessionSetCookies(
state,attributes,prefix?):string[]
Parameters
state
attributes
CookieAttributes
prefix?
string
Returns
string[]
setCookieHeadersOf()
setCookieHeadersOf(
response):string[]
Parameters
response
Response
Returns
string[]
upstreamCookieHeader()
upstreamCookieHeader(
state):string
Parameters
state
Returns
string