Users and accounts¶
octomate.managers.user ¶
The cross-channel user registry: users, the channel profiles they own, and profile linking.
PROFILE_FIELDS
module-attribute
¶
LinkProfileUnavailable ¶
InvalidLinkProfile ¶
Bases: ValueError
A profile-link ticket that is invalid, expired or already used.
Source code in octomate/managers/user.py
ProfileAlreadyLinked ¶
Bases: ValueError
The channel profile is already linked to an account.
Source code in octomate/managers/user.py
ProfileNotLinked ¶
Bases: ValueError
The profile is not linked to the requesting account.
Source code in octomate/managers/user.py
UserManager ¶
Bases: Manager, Locks[tuple[str, str] | UUID7]
The persisted cross-channel user registry and verified profile links.
Source code in octomate/managers/user.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 | |
unlink_profile
async
¶
Source code in octomate/managers/user.py
owner
async
¶
Return the registered owner of profile, or None for a visitor.
Source code in octomate/managers/user.py
linked_profiles
async
¶
This human's other channel identities — the same person on another platform, reachable precisely because the registry links the accounts.
Empty for a visitor: only a registered User links identities, so an
unregistered account is one account and can be followed nowhere. owner
answers "whose is this"; this answers "where else are they".
Source code in octomate/managers/user.py
native_profile
async
¶
A transient anchor for username's native session on runtime's
pseudo-channel, or None for an unknown username.
Never persisted: a native session's identity comes from its verified bearer, not from a claimed row, so the profile exists only to give the linked-profile walk its starting point — owned like a stored profile, and standing on a channel id no channel ever resolves.
Source code in octomate/managers/user.py
profile
async
¶
The stored profile for a channel identity, or None if never observed.
The read-only sibling of ensure_profile, for callers that hold only a
channel identity — e.g. a deferred batch resuming long after the message
that carried the sender's profile snapshot.
Source code in octomate/managers/user.py
ensure_profile
async
¶
Persist the latest channel snapshot and return its registry profile.
First sight creates an ownerless visitor profile. An existing profile
keeps its ownership while observations refresh its display fields. An
observed.user_id is the one exception: no channel ever sets it —
only a verified bearer's transient anchor (native_profile) carries
one — so an identity that arrives owned stays owned.
Source code in octomate/managers/user.py
hash_link_token
staticmethod
¶
link_verified_profile
async
¶
Link an OAuth-verified profile without replacing an existing owner.
Source code in octomate/managers/user.py
start_link_profile
async
¶
Replace this ownerless profile's pending ticket and return its private URL.
Source code in octomate/managers/user.py
inspect_link_profile
async
¶
Source code in octomate/managers/user.py
confirm_link_profile
async
¶
Consume a valid ticket and link its exact profile to user once.
Source code in octomate/managers/user.py
octomate.managers.auth ¶
Invite-only registration, local passwords, sessions and personal API keys.
InvalidCredentials ¶
Bases: ValueError
A sign-in, refresh or password change whose credentials are wrong or expired.
Source code in octomate/managers/auth.py
UsernameUnavailable ¶
AuthManager ¶
Invite-only registration, local passwords, and user credentials.
Source code in octomate/managers/auth.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 | |
dummy_password_hash
instance-attribute
¶
hash_password
async
¶
hash_token
staticmethod
¶
invite
async
¶
Issue an anonymous code that admits one new account.
Source code in octomate/managers/auth.py
register
async
¶
Source code in octomate/managers/auth.py
login
async
¶
Source code in octomate/managers/auth.py
authenticate_session
async
¶
Source code in octomate/managers/auth.py
set_password
async
¶
set_password(
username: str,
password: SecretStr,
*,
current_password: SecretStr | None = None,
) -> None
Replace a password and end browser sessions; HTTP callers must supply the old password.
Source code in octomate/managers/auth.py
logout
async
¶
Source code in octomate/managers/auth.py
refresh_session
async
¶
Source code in octomate/managers/auth.py
revoke_session
async
¶
Source code in octomate/managers/auth.py
create_api_key
async
¶
create_api_key(
user_id: UUID7,
*,
name: str,
scopes: list[ApiKeyScope],
expires_at: AwareDatetime | None = None,
) -> IssuedApiKey
Issue for a verified user; the HTTP caller must establish that identity.