Skip to content

Conversation

@DiamondJoseph
Copy link
Contributor

@DiamondJoseph DiamondJoseph commented Mar 17, 2025

Parked while I return to DLS work.

  • Authenticator, AccessPolicy, Tree deserialization modified to behave like a discriminated union
  • Impls of AccessPolicy directly extend it for type checking purposes
  • Authentication top level of config merged into Settings object
  • Tree -> Trees in Settings object* [not sure about this- presumably there is a MapAdapter type that can hold a list of MapAdapters and be a root Tree instead?]
  • Authenticator.providers + Authenticator -> Authenticators in Settings object (until can reduce down to 1)
  • AccessPolicy on root of Settings documented* [not sure about this- re: Tree above, if root Tree object can put access policy on that]
  • AccessPolicy for individual trees moved out of MapAdapter object* [not sure about this- do we need on MapAdapter? Or just pass in the Tree + AccessPolicy + Path into functions that check access]

Checklist

  • Add a Changelog entry
  • Add the ticket number which this PR closes to the comment section

@DiamondJoseph DiamondJoseph force-pushed the no_authentication_config branch from 1460e56 to e1da792 Compare March 27, 2025 16:18
@DiamondJoseph DiamondJoseph force-pushed the no_authentication_config branch 2 times, most recently from 298f472 to 95aab6a Compare March 28, 2025 13:17
@DiamondJoseph DiamondJoseph force-pushed the no_authentication_config branch from 95aab6a to bcdbe08 Compare March 28, 2025 13:33

app = build_app(MapAdapter({}), authentication={"authenticator": DummyAuthenticator()})
app = build_app(
MapAdapter({}), server_settings=Settings(authenticator=DummyAuthenticator())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo: move MapAdapter into Settings

tree: catalog
args:
tree:
type: catalog
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be fully qualified now

tree: catalog
args:
tree:
type: catalog
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be fully qualified now
Find and replace type: catalog

},
)
return build_app(tree, authentication={"single_user_api_key": "secret"})
return build_app(tree, server_settings=Settings(single_user_api_key="secret"))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass tree into Settings



class AccessPolicy(Protocol):
class AccessPolicy(ABC):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo: Can AccessPolicy impls be made BaseModels, like Authenticators are? To ensure deserialization behaves

) from err
context = Context.from_app(
build_app_from_config(config, source_filepath=filepath),
build_app_from_config(merged.pop("direct", {}), source_filepath=filepath),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "direct" another word like Authentication that needs to be excised?

env_nested_delimiter="_",
)

def check_scalable(self):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo: Make this a validator for the class- currently only distinguishes the case where secret_keys has been explicitly set as an empty list or database uri has been explicitly set to blank, we need to check that those keys have been explicitly set at all.

@danielballan
Copy link
Member

We anticipate that access_control become a server-wide singleton, like authentication, instead of a setting applied separately to each tree. #951

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants