Networks from which a user with a role has confirmed with an emailed code. The other half of the check that a staff session is really its owner: a request is recognized when the user’s remembered browser comes from an address inside one of these networks, in the same country. Expired rows are hard-deleted.
| Name | Type | Default | Nullable | Children | Parents | Comment |
|---|---|---|---|---|---|---|
| country | varchar(16) | true | Lowercase country code of the verifying address. A request matches only from the same country. NULL when the address had no known country; such a row matches only addresses that have none either. | |||
| created_at | timestamp with time zone | now() | false | Timestamp when the record was created. | ||
| expires_at | timestamp with time zone | false | When the network stops being recognized. Pushed forward when it is used close to expiry. | |||
| id | uuid | uuid_generate_v4() | false | A unique, stable identifier for the record. | ||
| network | cidr | false | The address block the verification covers. Starts as the IPv4 /16 or IPv6 /32 around the verifying address (exact /32 or /64 without a country), and may widen to at most /12 or /29 within 24 hours of verified_at. | |||
| updated_at | timestamp with time zone | now() | false | Timestamp when the record was last updated. The field is updated automatically by the set_timestamp trigger. | ||
| user_id | uuid | false | public.users | The user who verified the network. | ||
| verified_at | timestamp with time zone | now() | false | When a code was last entered for this network. Widening is allowed only in the 24 hours after it. | ||
| verified_by_browser_id | uuid | true | public.staff_security_verified_browsers | The browser that last entered a code for this network. Only that browser may widen the network. NULL once that browser is forgotten. |
| Name | Type | Definition |
|---|---|---|
| staff_security_verified_networks_countryless_exact | CHECK | CHECK (((country IS NOT NULL) OR (masklen((network)::inet)
= CASE WHEN (family((network)::inet) = 4) THEN 32 ELSE 64 END))) |
| staff_security_verified_networks_created_at_not_null | n | NOT NULL created_at |
| staff_security_verified_networks_expires_at_not_null | n | NOT NULL expires_at |
| staff_security_verified_networks_id_not_null | n | NOT NULL id |
| staff_security_verified_networks_network_not_null | n | NOT NULL network |
| staff_security_verified_networks_pkey | PRIMARY KEY | PRIMARY KEY (id) |
| staff_security_verified_networks_updated_at_not_null | n | NOT NULL updated_at |
| staff_security_verified_networks_user_id_fkey | FOREIGN KEY | FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE |
| staff_security_verified_networks_user_id_not_null | n | NOT NULL user_id |
| staff_security_verified_networks_verified_at_not_null | n | NOT NULL verified_at |
| staff_security_verified_networks_verified_by_browser_id_fkey | FOREIGN KEY | FOREIGN KEY (verified_by_browser_id) REFERENCES staff_security_verified_browsers(id) ON DELETE SET NULL |
| Name | Definition |
|---|---|
| staff_security_verified_networks_expires_at | CREATE INDEX staff_security_verified_networks_expires_at ON public.staff_security_verified_networks USING btree (expires_at) |
| staff_security_verified_networks_pkey | CREATE UNIQUE INDEX staff_security_verified_networks_pkey ON public.staff_security_verified_networks USING btree (id) |
| staff_security_verified_networks_user_id | CREATE INDEX staff_security_verified_networks_user_id ON public.staff_security_verified_networks USING btree (user_id) |
| Name | Definition |
|---|---|
| set_timestamp | CREATE TRIGGER set_timestamp BEFORE UPDATE ON public.staff_security_verified_networks FOR EACH ROW EXECUTE FUNCTION trigger_set_timestamp() |
Generated by tbls