Manta Developers
GitHub
Menu

@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

const agentsJwtCookieName: "auth" = "auth"


badSessionCookiePrefixMessage

const badSessionCookiePrefixMessage: "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

const maxSessionCookieChunks: 8 = 8


sessionCookiePrefix

const sessionCookiePrefix: "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

MantaSessionState

response

Response

now?

number

Returns

MantaSessionState


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

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

string

Returns

string


sessionsDiffer()

sessionsDiffer(before, after): boolean

Parameters

before

MantaSessionState

after

MantaSessionState

Returns

boolean


sessionSetCookies()

sessionSetCookies(state, attributes, prefix?): string[]

Parameters

state

MantaSessionState

attributes

CookieAttributes

prefix?

string

Returns

string[]


setCookieHeadersOf()

setCookieHeadersOf(response): string[]

Parameters

response

Response

Returns

string[]


upstreamCookieHeader()

upstreamCookieHeader(state): string

Parameters

state

MantaSessionState

Returns

string