def ent_of

cswap-bend-cli@0.1.0.0 · daemon/gather.bend:61

import cswap-bend-cli@0.1.0.0/daemon/gather.bend as Gather
import Base
import cswap-bend-cli@0.1.0.0/json.bend as Json
import cswap-bend-cli@0.1.0.0/store/base.bend as SBase
import cswap-bend-cli@0.1.0.0/store/seq.bend as SSeq
import cswap-bend-cli@0.1.0.0/policy/types.bend as T

61def ent_of(+slot: String, +rec: Json.Json, +creds: String, +cfg_ok: Bool, +quarantined: Bool) -> Ent:
62  Ent{slot, SSeq.field_str(rec, "email"), SSeq.field_str(rec, "organizationUuid"), creds,
63    T.Account{U32.to_nat(SSeq.str_u32(slot)), SSeq.field_str(rec, "email"), kind_of(SSeq.is_api_key_rec(rec), creds),
64      is_true(Json.get("disabled", rec)) || quarantined || Bool.not(SBase.nonempty(creds) && cfg_ok)}}

Uses (16)

Used by (1)