Skip to content

Commit ebadd52

Browse files
committed
docs: update tips to describe non-upstream URL
1 parent 6084e0b commit ebadd52

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

docs/user-guide/tips.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,31 +41,30 @@ OPENAPI_AUTH_SCHEME_OVERRIDE='{
4141

4242
## Non-proxy Configuration
4343

44-
While the project is designed to work out-of-the-box as an application, it might not address every projects needs. When the need for customization arises, the codebase can instead be treated as a library of components that can be used to augment a FastAPI server. This may look something like the following:
44+
While the STAC Auth Proxy is designed to work out-of-the-box as an application, it might not address every projects needs. When the need for customization arises, the codebase can instead be treated as a library of components that can be used to augment a FastAPI server.
45+
46+
This may look something like the following:
4547

4648
```py
4749
from fastapi import FastAPI
4850
from stac_fastapi.api.app import StacApi
49-
from stac_auth_proxy import build_lifespan, configure_app, Settings as StacAuthSettings
51+
from stac_auth_proxy import configure_app, Settings as StacAuthSettings
5052

5153
# Create Auth Settings
5254
auth_settings = StacAuthSettings(
53-
upstream_url='https://stac-server',
55+
upstream_url='https://stac-server', # Dummy value, we don't make use of this value in non-proxy mode
5456
oidc_discovery_url='https://auth-server/.well-known/openid-configuration',
5557
)
5658

5759
# Setup App
58-
app = FastAPI(
59-
...
60-
lifespan=build_lifespan(auth_settings),
61-
)
60+
app = FastAPI( ... )
6261

6362
# Apply STAC Auth Proxy middleware
6463
configure_app(app, auth_settings)
6564

6665
# Setup STAC API
67-
api = StacApi(
68-
app,
69-
...
70-
)
66+
api = StacApi( app, ... )
7167
```
68+
69+
> [!IMPORTANT]
70+
> Avoid using `build_lifespan()` when operating in non-proxy mode, as we are unable to check for the non-existent upstream API.

0 commit comments

Comments
 (0)