yumemi/require

Requirements are evaluated after argument decoding(0.12)。

申告と同意の種類は app が名付ける。申告の種類は src/server.gleam の browser.declarations、同意の種類は consents に無ければ生成器が exit 4 で止める(51 v6 第 32・40 条)。

Types

pub type Requirement(args) {
  Declared(kind: String)
  Consented(kind: String)
  ConsentedFor(kind: String, subject: fn(args) -> String)
  Challenged(action: String)
}

Constructors

  • Declared(kind: String)

    browser の署名 cookie の申告 kind が期間の内。無ければ 403 {"code": "declaration_missing", "declaration": kind}

  • Consented(kind: String)

    session の party が同意 kind を持つ。無ければ 403 {"code": "consent_missing", "consent": kind}

  • ConsentedFor(kind: String, subject: fn(args) -> String)

    party が対象 subject(args) についての同意 kind を持つ(対象を Args と突き合わせる同意)

  • Challenged(action: String)

    人の確かめ(B8、0.16.0)を通った要求だけを通す。action は業者の siteverify が返す action と突き合わせる名。 業者は src/server.gleam の challenge。要件に置くのは、確かめが Service ごと(新規登録・問い合わせ)に要るため。 通らなければ 400 {"code": "invalid_argument", "field": <challenge.field>}、業者に届かなければ 503 upstream_unavailable

✨ Search Document