mirror of
https://github.com/suitenumerique/docs.git
synced 2026-09-30 13:35:10 +02:00
OIDC_STORE_REFRESH_TOKEN_KEY is a mandatory secret key. We can not push it on github and we want any contributor to be able to run the app by only running bootstrap. We then must generate the variable in the bootstrap. Signed-off-by: charles <charles.englebert@protonmail.com>
1.7 KiB
1.7 KiB
Setup Find search for Docs
This configuration will enable Find searches:
- Each save on core.Document or core.DocumentAccess will trigger the indexing of the document into Find.
- The
api/v1.0/documents/search/will be used as proxy for searching documents from Find indexes.
Create an index service for Docs
Configure a Service for Docs application with these settings
- Name:
docs
request.auth.name of the Docs application. - Client id:
impress
Name of the token audience or client_id of the Docs application.
See how-to-use-indexer.md for details.
Configure settings of Docs
Find uses a service provider authentication for indexing and a OIDC authentication for searching.
Add those Django settings to the Docs application to enable the feature.
SEARCH_INDEXER_CLASS="core.services.search_indexers.FindDocumentIndexer"
SEARCH_INDEXER_COUNTDOWN=10 # Debounce delay in seconds for the indexer calls.
SEARCH_INDEXER_QUERY_LIMIT=50 # Maximum number of results expected from the search endpoint
INDEXING_URL="http://find:8000/api/v1.0/documents/index/"
SEARCH_URL="http://find:8000/api/v1.0/documents/search/"
# Service provider authentication
SEARCH_INDEXER_SECRET="find-api-key-for-docs-with-exactly-50-chars-length"
# OIDC authentication
OIDC_STORE_ACCESS_TOKEN=True # Store the access token in the session
OIDC_STORE_REFRESH_TOKEN=True # Store the encrypted refresh token in the session
OIDC_STORE_REFRESH_TOKEN_KEY="<your-32-byte-encryption-key==>"
OIDC_STORE_REFRESH_TOKEN_KEY must be a valid Fernet key (32 url-safe base64-encoded bytes).
To create one, use the bin/generate-oidc-store-refresh-token-key.sh command.