Skip to content

Filter unauthorized views in InformationSchema#10874

Merged
jon-wei merged 3 commits intoapache:masterfrom
jon-wei:view_information_schema
Feb 17, 2021
Merged

Filter unauthorized views in InformationSchema#10874
jon-wei merged 3 commits intoapache:masterfrom
jon-wei:view_information_schema

Conversation

@jon-wei
Copy link
Contributor

@jon-wei jon-wei commented Feb 10, 2021

This PR adjusts the InformationSchema class such that it properly filters out views based on authorization checks. Previously it checked the view subschema against the "druid" schema name, and thus fell back on the unfiltered path.

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

final AuthorizerMapper authorizerMapper,
@DruidSchemaName String druidSchemaName
@DruidSchemaName String druidSchemaName,
@ViewSchemaName String viewSchemaName
Copy link
Member

Choose a reason for hiding this comment

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

I guess NamedViewSchema should probably use this injected name instead of its own name, and also SqlResourceCollectorShuttle should probably accept it as well since it does for druid schema name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would take some additional changes in DruidPlanner and beyond to support passing in the view name, so I decided to just use a fixed name for the view schema, I don't think the additional complexity is worth it currently.

@jon-wei jon-wei merged commit 8ad6813 into apache:master Feb 17, 2021
@clintropolis clintropolis added this to the 0.22.0 milestone Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants