Skip to content

Commit 86bb5ef

Browse files
committed
docs
1 parent 6c0449d commit 86bb5ef

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
- Added option to include Basic Auth.
11+
1012
## [v2.3.0]
1113

1214
### Changed

README.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,3 +272,83 @@ curl -X "POST" "http://localhost:9200/_aliases" \
272272
```
273273

274274
The modified Items with lowercase identifiers will now be visible to users accessing `my-collection` in the STAC API.
275+
276+
277+
## Basic Auth
278+
279+
#### Environment Variable Configuration
280+
281+
Basic authentication is an optional feature. You can enable it by setting the environment variable `BASIC_AUTH` as a JSON string.
282+
283+
Example:
284+
```
285+
BASIC_AUTH={"users":[{"username":"user","password":"pass","permissions":"*"}]}
286+
```
287+
288+
### User Permissions Configuration
289+
290+
In order to set endpoints with specific access permissions, you can configure the `users` key with a list of user objects. Each user object should contain the username, password, and their respective permissions.
291+
292+
Example: This example illustrates the configuration for two users: an **admin** user with full permissions (*) and a **reader** user with limited permissions to specific read-only endpoints.
293+
```json
294+
{
295+
"users": [
296+
{
297+
"username": "admin",
298+
"password": "admin",
299+
"permissions": "*"
300+
},
301+
{
302+
"username": "reader",
303+
"password": "reader",
304+
"permissions": [
305+
{"path": "/", "method": ["GET"]},
306+
{"path": "/conformance", "method": ["GET"]},
307+
{"path": "/collections/{collection_id}/items/{item_id}", "method": ["GET"]},
308+
{"path": "/search", "method": ["GET", "POST"]},
309+
{"path": "/collections", "method": ["GET"]},
310+
{"path": "/collections/{collection_id}", "method": ["GET"]},
311+
{"path": "/collections/{collection_id}/items", "method": ["GET"]},
312+
{"path": "/queryables", "method": ["GET"]},
313+
{"path": "/queryables/collections/{collection_id}/queryables", "method": ["GET"]},
314+
{"path": "/_mgmt/ping", "method": ["GET"]}
315+
]
316+
}
317+
]
318+
}
319+
```
320+
321+
322+
### Public Endpoints Configuration
323+
324+
In order to set endpoints with public access, you can configure the public_endpoints key with a list of endpoint objects. Each endpoint object should specify the path and method of the endpoint.
325+
326+
Example: This example demonstrates the configuration for public endpoints, allowing access without authentication to read-only endpoints.
327+
```json
328+
{
329+
"public_endpoints": [
330+
{"path": "/", "method": "GET"},
331+
{"path": "/conformance", "method": "GET"},
332+
{"path": "/collections/{collection_id}/items/{item_id}", "method": "GET"},
333+
{"path": "/search", "method": "GET"},
334+
{"path": "/search", "method": "POST"},
335+
{"path": "/collections", "method": "GET"},
336+
{"path": "/collections/{collection_id}", "method": "GET"},
337+
{"path": "/collections/{collection_id}/items", "method": "GET"},
338+
{"path": "/queryables", "method": "GET"},
339+
{"path": "/queryables/collections/{collection_id}/queryables", "method": "GET"},
340+
{"path": "/_mgmt/ping", "method": "GET"}
341+
],
342+
"users": [
343+
{
344+
"username": "admin",
345+
"password": "admin",
346+
"permissions": "*"
347+
}
348+
]
349+
}
350+
```
351+
352+
### Basic Authentication Configurations
353+
354+
See `docker-compose.basic_auth_protected.yml` and `docker-compose.basic_auth_public.yml` for basic authentication configurations.

0 commit comments

Comments
 (0)