Differences From
Artifact [4782518865]:
30 30
31 31 terra m.powerset:affect_users()
32 32 return self.purge() or self.censor() or self.suspend() or
33 33 self.elevate() or self.demote() or self.rebrand() or
34 34 self.cred()
35 35 end
36 36
37 -local str = rawstring --lib.mem.ptr(int8)
37 +local str = rawstring
38 +local pstr = lib.mem.ptr(int8)
38 39
39 40 struct m.source
40 41
41 42 struct m.rights {
42 43 rank: uint16 -- lower = more powerful except 0 = regular user
43 44 -- creating staff automatically assigns rank immediately below you
44 45 quota: uint32 -- # of allowed tweets per day; 0 = no limit
................................................................................
61 62
62 63 struct m.actor {
63 64 id: uint64
64 65 nym: str
65 66 handle: str
66 67 origin: uint64
67 68 bio: str
69 + title: str
68 70 avatar: str
69 71 knownsince: m.timepoint
70 72 rights: m.rights
71 73 key: lib.mem.ptr(uint8)
72 74
73 75 -- ephemera
74 76 xid: str
................................................................................
169 171 open: &m.source -> &opaque
170 172 close: &m.source -> {}
171 173
172 174 conf_get: {&m.source, rawstring} -> lib.mem.ptr(int8)
173 175 conf_set: {&m.source, rawstring, rawstring} -> {}
174 176 conf_reset: {&m.source, rawstring} -> {}
175 177
176 - actor_save: {&m.source, m.actor} -> bool
177 - actor_create: {&m.source, m.actor} -> bool
178 + actor_save: {&m.source, &m.actor} -> bool
179 + actor_create: {&m.source, &m.actor} -> uint64
178 180 actor_fetch_xid: {&m.source, lib.mem.ptr(int8)} -> lib.mem.ptr(m.actor)
179 181 actor_fetch_uid: {&m.source, uint64} -> lib.mem.ptr(m.actor)
180 182 actor_notif_fetch_uid: {&m.source, uint64} -> lib.mem.ptr(m.notif)
181 183 actor_enum: {&m.source} -> lib.mem.ptr(&m.actor)
182 184 actor_enum_local: {&m.source} -> lib.mem.ptr(&m.actor)
183 185 actor_stats: {&m.source, uint64} -> m.actor_stats
184 186
185 187 actor_auth_how: {&m.source, m.inet, rawstring} -> {m.credset, bool}
186 188 -- returns a set of auth method categories that are available for a
187 189 -- given user from a certain origin
188 190 -- origin: inet
189 191 -- username: rawstring
190 - actor_auth_otp: {&m.source, m.inet, rawstring, rawstring} -> uint64
191 - actor_auth_pw: {&m.source, m.inet, lib.mem.ptr(int8), lib.mem.ptr(int8) } -> uint64
192 + actor_auth_otp: {&m.source, m.inet, rawstring, rawstring}
193 + -> {uint64, uint64, pstr}
194 + actor_auth_pw: {&m.source, m.inet, lib.mem.ptr(int8), lib.mem.ptr(int8) }
195 + -> {uint64, uint64, pstr}
192 196 -- handles password-based logins against hashed passwords
193 197 -- origin: inet
194 198 -- handle: rawstring
195 199 -- token: rawstring
196 - actor_auth_tls: {&m.source, m.inet, rawstring} -> uint64
200 + actor_auth_tls: {&m.source, m.inet, rawstring}
201 + -> {uint64, uint64, pstr}
197 202 -- handles implicit authentication performed as part of an TLS connection
198 203 -- origin: inet
199 204 -- fingerprint: rawstring
200 205 actor_auth_api: {&m.source, m.inet, rawstring, rawstring} -> uint64
206 + -> {uint64, uint64, pstr}
201 207 -- handles API authentication
202 208 -- origin: inet
203 209 -- handle: rawstring
204 210 -- key: rawstring (X-API-Key)
205 211 actor_auth_record_fetch: {&m.source, uint64} -> lib.mem.ptr(m.auth)
212 + actor_powers_fetch: {&m.source, uint64} -> m.powerset
206 213 actor_session_fetch: {&m.source, uint64, m.inet} -> {lib.stat(m.auth), lib.mem.ptr(m.actor)}
207 214 -- retrieves an auth record + actor combo suitable by AID suitable
208 215 -- for determining session validity & caps
209 216 -- aid: uint64
210 217 -- origin: inet
218 + actor_auth_register_uid: {&m.source, uint64, uint64} -> {}
219 + -- notifies the backend module of the UID that has been assigned for
220 + -- an authentication ID
221 + -- aid: uint64
222 + -- uid: uint64
211 223
212 224 actor_conf_str: cnf(rawstring, lib.mem.ptr(int8))
213 225 actor_conf_int: cnf(intptr, lib.stat(intptr))
214 226
215 227 post_save: {&m.source, &m.post} -> {}
216 228 post_create: {&m.source, &m.post} -> uint64
217 229 actor_post_fetch_uid: {&m.source, uint64, m.range} -> lib.mem.ptr(m.post)