Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Briar Mailbox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
briar
Briar Mailbox
Commits
6cadefec
Verified
Commit
6cadefec
authored
3 years ago
by
Sebastian
Browse files
Options
Downloads
Patches
Plain Diff
Add documentation for ContactsManager methods
parent
d8c26095
No related branches found
No related tags found
1 merge request
!49
Add documentation for ContactsManager methods
Pipeline
#8536
passed
3 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mailbox-core/src/main/java/org/briarproject/mailbox/core/contacts/ContactsManager.kt
+16
-3
16 additions, 3 deletions
...org/briarproject/mailbox/core/contacts/ContactsManager.kt
with
16 additions
and
3 deletions
mailbox-core/src/main/java/org/briarproject/mailbox/core/contacts/ContactsManager.kt
+
16
−
3
View file @
6cadefec
...
...
@@ -29,7 +29,10 @@ class ContactsManager @Inject constructor(
}
/**
* Used by owner to list contacts.
* Used by owner to list contacts managed by the mailbox.
*
* Checks if provided auth token is the owner.
* Responds with 200 (OK) with the list of contact IDs in JSON.
*/
suspend
fun
listContacts
(
call
:
ApplicationCall
)
{
authManager
.
assertIsOwner
(
call
.
principal
())
...
...
@@ -42,7 +45,14 @@ class ContactsManager @Inject constructor(
}
/**
* Used by owner to add new contacts.
* Used by owner to add a new contact to the mailbox.
*
* Briar generates 32 bytes of random data for bearer token, inboxId and outboxId, encodes
* them as hexadecimal strings and sends them along with its contactId.
*
* Checks if provided auth token is the owner.
* Responds with 201 (CREATED) for a successful POST. If the contactId is already in use,
* 409 (CONFLICT) is returned.
*/
suspend
fun
postContact
(
call
:
ApplicationCall
)
{
authManager
.
assertIsOwner
(
call
.
principal
())
...
...
@@ -72,7 +82,10 @@ class ContactsManager @Inject constructor(
}
/**
* Used by owner to add remove contacts.
* Used by owner to remove a contact.
*
* [paramContactId] is the integer contact ID the contact was added with.
* Returns 200 (OK) when deletion was successful.
*/
fun
deleteContact
(
call
:
ApplicationCall
,
paramContactId
:
String
)
{
authManager
.
assertIsOwner
(
call
.
principal
())
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment