common/headers.aug
OpenID Connect login application · Source and specification
Files in this project
main.augclient/contracts.augclient/endpoints.augclient/export.augclient/login.augclient/logout.augclient/protocol.augclient/session.augclient/views.augcommon/export.augcommon/headers.augcommon/keys.augcommon/settings.augcommon/views.augprovider/authorization.augprovider/contracts.augprovider/credentials.augprovider/discovery.augprovider/export.augprovider/token.augprovider/userinfo.augprovider/views.aug
Code
// aug-spec: "headers.aug.md" explains this file. Read it before changes; refresh with aug spec.
/** Responses containing identity data are never cached or embedded by another site. */
securityHeaders():
return Headers().with(name="cache-control", value="no-store").with(
name="pragma",
value="no-cache"
).with(
name="x-content-type-options",
value="nosniff"
).with(
name="referrer-policy",
value="no-referrer"
).with(
name="content-security-policy",
value="default-src 'self'; style-src 'unsafe-inline'; script-src 'self'; frame-ancestors 'none'; base-uri 'none'; form-action 'self'"
)
/** Add a checked cookie without losing duplicate Set-Cookie response fields. */
withCookie(Headers headers, string name, string value, string path, int maxAge, bool secure):
result = headers
for content in cookie(name, value, path, maxAge, secure).all(name="set-cookie"):
result = result.with(name="set-cookie", value=content)
return result
import cookie from web// aug-spec: "headers.aug.md" explains this file. Read it before changes; refresh with aug spec.
/** Responses containing identity data are never cached or embedded by another site. */
securityHeaders() {
return Headers().with(name="cache-control", value="no-store").with(
name="pragma",
value="no-cache"
).with(
name="x-content-type-options",
value="nosniff"
).with(
name="referrer-policy",
value="no-referrer"
).with(
name="content-security-policy",
value="default-src 'self'; style-src 'unsafe-inline'; script-src 'self'; frame-ancestors 'none'; base-uri 'none'; form-action 'self'"
)
}
/** Add a checked cookie without losing duplicate Set-Cookie response fields. */
withCookie(Headers headers, string name, string value, string path, int maxAge, bool secure) {
result = headers
for content in cookie(name, value, path, maxAge, secure).all(name="set-cookie") {
result = result.with(name="set-cookie", value=content)
}
return result
}
import cookie from webCompiled specification
securityHeaders · source
Responses containing identity data are never cached or embedded by another site. Failures can raise HttpError. It returns headers starting with a Headers and adding these fields in order: "cache-control" to "no-store", "pragma" to "no-cache", "x-content-type-options" to "nosniff", "referrer-policy" to "no-referrer", and "content-security-policy" to "default-src 'self'; style-src 'unsafe-inline'; script-src 'self'; frame-ancestors 'none'; base-uri 'none'; form-action 'self'". source
Checked interface
securityHeaders() returns Headers unless HttpErrorFailures can raise HttpError.
withCookie · source
Add a checked cookie without losing duplicate Set-Cookie response fields. It takes headers as Headers, name, value, and path as strings, maxAge as an integer, and secure as a boolean. Failures can raise HttpError.
It sets result to headers. For each content in a snapshot of all on cookie with name, value, path, maxAge, and secure with name "set-cookie", it sets result to result with the header "set-cookie" set to content. After the loop, it returns result. source
Checked interface
withCookie(Headers headers, string name, string value, string path, int maxAge, bool secure) returns Headers unless HttpErrorIt takes headers as Headers, name, value, and path as strings, maxAge as an integer, and secure as a boolean. Failures can raise HttpError.
Dependencies
It uses cookie from web.
Built-in operations follow the language reference.