-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdocumentation.lisp
222 lines (152 loc) · 6.32 KB
/
documentation.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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
(in-package #:org.shirakumo.maiden.agents.accounts)
;; account.lisp
(docs:define-docs
(function charr
"Return a list of all characters in the specified code range.")
(function chars
"Return a list of all characters from the given code chars.")
(variable *illegal-account-name-chars*
"A list of characters that are not allowed in account names for security purposes.")
(function normalize-account-name
"Remove all illegal characters from the account name.
See *ILLEGAL-ACCOUNT-NAME-CHARS*")
(variable *accounts*
"Map of names to account objects.")
(variable *identity-account-map*
"Map of identity strings to account objects.")
(type account
"This class represents an account.
Accounts are things by which users can be linked across
different networks and different identities. Users can
also store information and preferences in an account,
which can then be reused by other parts of the system to
provide better user interaction.
See IDENTITIES
See PASSWORD
See MAIDEN:NAMED-ENTITY
See MAIDEN:DATA-ENTITY")
(function identities
"Accessor to the list of identities that this account is tied to.
An identity attempts to identify a user object on a
client. This way, an authenticated user on a client
can use an account directly without the need for a
manual login.
See ACCOUNT")
(function password
"Accessor to the password of the account.
See ACCOUNT")
(function offload
"Store the account object to file to ensure it is persisted.")
(function identity
"Construct an identity string for the given object.")
(function add-identity
"Add a new identity to the account.
See ACCOUNT
See IDENTITY")
(function remove-identity
"Remove an identity from an account.
See ACCOUNT
See IDENTITY")
(function identity-p
"Returns whether the given identity is one for the given account.
See ACCOUNT
See IDENTITY")
(function account-pathname
"Return the proper pathname to the storage file for an account of the given name.
See MAIDEN-STORAGE:CONFIG-PATHNAME
See NORMALIZE-ACCOUNT-NAME")
(function account
"Return the account object suitable for the given object.
If :ERROR is non-NIL and no suitable account for the
given object can be found, a condition of type NO-
ACCOUNT-FOR-IDENTITY is signalled.")
(function delete-account
"Completely delete the given account.
This will also delete the storage file on disk, so
the account will be gone for good once its object is
garbage-collected.")
(function load-all-accounts
"Load all the account objects from disk and make sure they're ready for use."))
;; conditions.lisp
(docs:define-docs
(type account-condition
"Superclass for all conditions relating to the account system.")
(type field-access-denied
"Condition signalled when a field is attempted to be accessed, which is not accessible to the user.
See ACCOUNT-CONDITION")
(type no-account-for-identity
"Condition signalled when no matching account can be found for the identity.
See ACCOUNT-CONDITION")
(type account-not-found
"Condition signalled when no account can be found for a given name or object.
See ACCOUNT-CONDITION")
(type account-already-exists
"Condition signalled when an account is attempted to be created, but already exists.
See ACCOUNT-CONDITION"))
;; fields.lisp
(docs:define-docs
(variable *field-info*
"This table maps field names to field-info instances.
See FIELD-INFO")
(type field-info
"This class represents metadata information about an account field.
Using this info, the access to a field can be
restricted and the field's purpose can be documented.
See NAME
See CL:DOCUMENTATION
See ACCESS")
(function access
"Reader for the access information on the field-info.
Should be a property list mapping readers to access
permissions. A reader can be one of :OWNER :WORLD.
Access permissions can be :R :RW or NIL, describing
read-only, read-write, or no access respectively.
See FIELD-INFO")
(function field-info
"Accessor for the field-info object for the given field name.
See FIELD-INFO")
(function remove-field-info
"Remove the field-info object for the given field.
See FIELD-INFO")
(function define-fields
"Define account field information.
Each field must be a lambda-list of the following
structure:
(name (&key owner world) &optional documentation)
See FIELD-INFO
See ACCESS")
(function access-p
"Returns true if the given user has access to the given field and account.
See ACCOUNT
See FIELD-INFO")
(function field
"Access the given field on the account, using the user as the accessing identity.
See ACCESS-P
See FIELD-INFO
See ACCOUNT"))
;; interface.lisp
(docs:define-docs
(type accounts
"This agent handles user accounts and related information. User accounts can be used to store information about a user, allowing the bot to tailor responses to them. Accounts also allow authentication of users on servers where no native authentication is possible.")
(function random-string
"Creates a string of random alphanumeric characters of the requested length.")
(command login
"Allows you to login in to an existing account in case your identity does not log you in automatically. If your identity is not associated, you might need to supply the account name.")
(command logout
"Explicitly log out from an account.")
(command create
"Create a new account. Accounts allow you to store information about yourself that may help the bot to better tailor responses to you. An account is also necessary for permission management. If no password is specified, one is randomly generated for you. Be sure not to do this on a public channel.")
(command destroy
"Destroy your own account. You need to be logged in in order to do this.")
(command update-password
"Change your account password. Be sure not to do this on a public channel.")
(command associate
"Associate the current identity with your account for automatic login. The identity must be authenticated by an outside source.")
(command deassociate
"Deassociate the current identity from your account, removing its automatic login.")
(command field
"Retrieve the value of a user account field.")
(command set-field
"Update the value of a user account field.")
(command test-authentication
"Test whether the bot can verify the authenticity of a user, or yourself."))