Skip to content

Commit

Permalink
Merge pull request #30 from bento-platform/chore/update-minor-refact
Browse files Browse the repository at this point in the history
chore: update bento_lib + deps, refact authz middleware create
  • Loading branch information
davidlougheed authored Dec 19, 2023
2 parents 4bf5a20 + 4f654f6 commit 1d4b3ea
Show file tree
Hide file tree
Showing 3 changed files with 250 additions and 236 deletions.
10 changes: 4 additions & 6 deletions bento_service_registry/authz.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
from bento_lib.auth.middleware.fastapi import FastApiAuthMiddleware
from .config import get_config
from .logger import get_logger

__all__ = [
"authz_middleware",
]

# TODO: Find a way to DI this
# TODO: Find a way to DI these
config = get_config()
logger = get_logger(config)


# Non-standard middleware setup so that we can import the instance and use it for dependencies too
authz_middleware = FastApiAuthMiddleware(
config.bento_authz_service_url,
debug_mode=config.bento_debug,
enabled=config.authz_enabled,
)
authz_middleware = FastApiAuthMiddleware.build_from_pydantic_config(config, logger)
Loading

0 comments on commit 1d4b3ea

Please sign in to comment.