From 051d3a356e3f5fcf80a63dd10290460524dd90c1 Mon Sep 17 00:00:00 2001 From: db0 Date: Sat, 24 Jun 2023 03:13:06 +0200 Subject: [PATCH] doc: Api descriptions --- fediseer/apis/v1/endorsements.py | 1 + fediseer/apis/v1/guarantees.py | 3 +++ fediseer/apis/v1/whitelist.py | 8 ++++---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/fediseer/apis/v1/endorsements.py b/fediseer/apis/v1/endorsements.py index a3d510c..56f0e05 100644 --- a/fediseer/apis/v1/endorsements.py +++ b/fediseer/apis/v1/endorsements.py @@ -66,6 +66,7 @@ class Endorsements(Resource): @api.response(404, 'Instance not registered', models.response_model_error) def put(self, domain): '''Endorse an instance + An endorsement signifies an approval from your instance to how that instance is being run. ''' self.args = self.put_parser.parse_args() if not self.args.apikey: diff --git a/fediseer/apis/v1/guarantees.py b/fediseer/apis/v1/guarantees.py index 7c5928f..e82a414 100644 --- a/fediseer/apis/v1/guarantees.py +++ b/fediseer/apis/v1/guarantees.py @@ -67,6 +67,9 @@ class Guarantees(Resource): @api.response(404, 'Instance not registered', models.response_model_error) def put(self, domain): '''Guarantee an instance + A instance can only be guaranteed by one other instance + An instance can guarantee up to 20 other instances + A guaranteed instance can guarantee and endorse other instances. ''' self.args = self.put_parser.parse_args() if not self.args.apikey: diff --git a/fediseer/apis/v1/whitelist.py b/fediseer/apis/v1/whitelist.py index d8e4a3b..edc853a 100644 --- a/fediseer/apis/v1/whitelist.py +++ b/fediseer/apis/v1/whitelist.py @@ -57,9 +57,9 @@ class WhitelistDomain(Resource): @api.marshal_with(models.response_model_instances, code=200, description='Instances') @api.response(400, 'Bad Request', models.response_model_error) def put(self, domain): - '''Register a new instance to the fediseer - An instance account has to exist in the fediseer lemmylemmy instance - That account will recieve the new API key via PM + '''Claim an fediverse instance. + If the instance hasn't been recorded yet it will be polled and added. + You must specify an admin account which will recieve the new API key via Private Message. ''' self.args = self.put_parser.parse_args() if '@' in self.args.admin: @@ -146,7 +146,7 @@ class WhitelistDomain(Resource): @api.response(401, 'Invalid API Key', models.response_model_error) @api.response(403, 'Forbidden', models.response_model_error) def delete(self, domain): - '''Delete claim to instance + '''Delete claim to instance (Not implemented) ''' return e.BadRequest("Not implemented") self.args = self.patch_parser.parse_args()