Documentation
¶
Overview ¶
Package auth0 carries a catalog of Auth0 Events event types and an example payload for each, embedded so the `ofga mappings` workspace can preview a rule without network access. See README.md for provenance.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Model ¶
func Model() string
Model is an authorization model every recipe in this catalog lints against: one file covering all twenty-one events rather than a fragment per event.
The recipes each declare the slice of it they need, which is what the recipe screen shows you. This is the other half of that — the union, in a form you can write to disk and hand to `ofga model write`.
Types ¶
type Event ¶
Event is one catalog entry: the event type, the group it is filed under in the picker, a one-line summary, and the decoded example payload.
type Recipe ¶
type Recipe struct {
Explain string
// Note is the short reason a recipe maps nothing, for the event picker's
// row. Mapped recipes leave it empty: their row counts what the rule
// produces, which is the more useful thing to know about them.
//
// Short is a hard constraint, not a preference: the row is the event type
// plus this, and the longest type is organization.connection.updated, which
// leaves a third of a narrow picker. A note that has to be truncated to fit
// cannot do the explaining it is here for.
//
// It exists because the count alone cannot say whose fault an empty one is.
// A row reading "user.created · no tuples" beside a status bar reading "4
// types" was read as the loaded model coming up short, which sent the user
// looking for the missing type. Nothing is missing — the event carries no
// relationship — and the row now says so before it is picked rather than on
// the screen after.
Note string
// Warn is a gap this recipe leaves, shown beside the rule rather than
// buried in Explain. These are the failures a user discovers in
// production: an event Auth0 never sends, a tuple the rule cannot reach,
// or a case it deliberately skips. A recipe with no such gap leaves it
// empty.
Warn string
Rule mapping.Rule
Requires []mapping.Requirement
}
Recipe is what the workspace knows about mapping one event: the rule it pre-loads, the model that rule assumes, and the sentences explaining the pairing. A recipe is teaching material first and a starting point second — the user edits it after loading, so it must be correct rather than clever.
Every event has a Recipe. An event that implies no relationship change has one whose Rule is empty and whose Explain says why: "no mapping" is a lesson, not a missing entry.