idisposable / cloudfinger Goto Github PK
View Code? Open in Web Editor NEWA webfinger handler build with CloudFlare Workers and KV Store
License: MIT License
A webfinger handler build with CloudFlare Workers and KV Store
License: MIT License
Need a simple API that allows for programmatic updating of the mappings. This will initially be used from the command line (e.g. curl
, and be secured by the same pre-shared-key AUTH_TOKEN
that the current /api/list
uses.
Add the following operations:
/api/get/:from
- GET the single mapping from a specific id (e.g. the mapping for [email protected])/api/add
- POST a new mapping with both a from and to in the POST body*/api/update/:from
- PUT an updated mapping with the new values for both the from and to in the PUT body*/api/delete/:from
- DELETE an existing mapping of the specified from valueURI: /api/add
- no additional parameters needed
Body:
{
"from": "[email protected]",
"to": "@[email protected]"
}
Result:
{
"success": true,
"errors": [ ]
}
Note: Will return false
with appropriate HTTP Status Code and an explanation in the errors
attribute. A 400-Bad Request
will be returned if either the from or the to are blank or both have the same value. A 409-Conflict
will be returned if the from already has an existing mapping that doesn't match the requested to value. If both the from and to values match a 200-OK
response will be returned (as this is likely a repeated request).
URI: /api/update/:from
where the from value is the from value of an existing mapping. This allow changing a mapping's from or to value at will. An example would be /api/update/[email protected]
.
Body:
{
"from": "[email protected]",
"to": "@[email protected]"
}
Result:
{
"success": true
"errors": [ ]
}
Note: Will return false
with appropriate HTTP Status Code and an explanation in the errors
attribute. 404-Not Found
status code means the URI from value was not in the existing mappings. 409-Conflict
status code means the post-body supplied from value already exists but is NOT the value supplied in the URI (e.g. you tried to change [email protected]'s from to [email protected] and that already has a mapping). If the existing mapping matches what was requested in the PUT, a 200-OK
status code will be returned (as this is likely a repeated request).
URI: /api/delete/:from
where the from value is the from value of an existing mapping. An example would be /api/update/[email protected]
. There is no DELETE body content
Result:
{
"success": true
"errors": [ ]
}
Note: Will return false
with appropriate HTTP Status Code and an explanation in the errors
attribute. 410 GONE means the URI from value was not in the existing mappings (as this is likely a repeated request).
Status Code | Description | List | Add | Update | Delete |
---|---|---|---|---|---|
200 OK | Indicates that the request has succeeded. | X | X | X | |
201 Created | Indicates that the request has succeeded and a new resource has been created as a result. | X | |||
204 No Content | The server has fulfilled the request but does not need to return a response body. The server may return the updated meta information. | X | |||
400 Bad Request | The request could not be understood by the server due to incorrect syntax. The client SHOULD NOT repeat the request without modifications. | X | X | X | X |
404 Not Found | The server can not find the requested resource. | X | X | ||
409 Conflict | The request could not be completed due to a conflict with the current state of the resource. | X | X | ||
410 Gone | The requested resource is no longer available at the server. | X | X |
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.