New: GET /api/key
This commit is contained in:
56
README.md
56
README.md
@@ -1,12 +1,6 @@
|
||||
# Neocities C API
|
||||
# Neocities API C library
|
||||
|
||||
Minimal, secure C wrapper for the Neocities API using API key authentication.
|
||||
|
||||
No login flow.
|
||||
No credential storage.
|
||||
Stateless by design.
|
||||
|
||||
Users must generate their own API key via the Neocities dashboard.
|
||||
Minimal, secure C wrapper for the Neocities API.
|
||||
|
||||
---
|
||||
|
||||
@@ -16,14 +10,9 @@ Users must generate their own API key via the Neocities dashboard.
|
||||
* File listing
|
||||
* Upload files
|
||||
* Delete files
|
||||
* Get API key
|
||||
* TLS verification enabled by default
|
||||
|
||||
Authentication is performed exclusively via:
|
||||
|
||||
```
|
||||
Authorization: Bearer <API_KEY>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Requirements
|
||||
@@ -38,17 +27,6 @@ sudo apt install libcurl4-openssl-dev
|
||||
|
||||
---
|
||||
|
||||
## Authentication
|
||||
|
||||
Generate your API key at:
|
||||
|
||||
Neocities > Settings > Manage Site Settings > API
|
||||
(or https://neocities.org/settings/YOUR-USERNAME#api_key)
|
||||
|
||||
If you're coding a CLI or application, you must provide the key at runtime (env var, config file, etc).
|
||||
|
||||
---
|
||||
|
||||
## API Overview
|
||||
|
||||
### Info (public)
|
||||
@@ -96,7 +74,11 @@ Deletes files from the site.
|
||||
|
||||
### API Key
|
||||
|
||||
For security reasons, you should get the API key via Neocities settings. This function is not avaiable.
|
||||
```c
|
||||
int neocities_apikey(const char *user, const char *pass, char **out);
|
||||
```
|
||||
|
||||
Get your API key.
|
||||
|
||||
---
|
||||
|
||||
@@ -106,28 +88,6 @@ See example.c
|
||||
|
||||
---
|
||||
|
||||
## Security Notes
|
||||
|
||||
* TLS verification is enforced
|
||||
* Redirects are disabled intentionally
|
||||
* API key is never persisted internally
|
||||
|
||||
Recommended:
|
||||
|
||||
* Store key in env vars
|
||||
* Avoid hardcoding
|
||||
|
||||
---
|
||||
|
||||
## Design Philosophy
|
||||
|
||||
* No login/password support
|
||||
* API key only
|
||||
* Explicit memory ownership
|
||||
* Minimal abstraction
|
||||
|
||||
---
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
|
||||
Reference in New Issue
Block a user