Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

security: fix security-config circular dependency #20821

Merged
merged 5 commits into from
Jul 3, 2024

Conversation

dotnwat
Copy link
Member

@dotnwat dotnwat commented Jul 3, 2024

Fixes circular dependency between security and config libraries.

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v24.1.x
  • v23.3.x
  • v23.2.x

Release Notes

  • none

dotnwat added 2 commits July 2, 2024 21:49
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
v::config depends on v::security_config which is composed of
config_bsl/rcl.cc which both include mtls.h which in turn depends on
config headers for things like config::binding, creating a circular
dependency on headers.

this commit splits out tls::rule which is the only type needed by
v::config and doesn't have dependences on any config headers.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
@dotnwat dotnwat requested a review from a team as a code owner July 3, 2024 04:52
@dotnwat dotnwat removed the request for review from a team July 3, 2024 04:56
@@ -22,8 +22,6 @@

#include <seastar/util/noncopyable_function.hh>

#include <boost/intrusive/list.hpp>
Copy link
Member Author

Choose a reason for hiding this comment

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

unrelated to the purpose of the pr, just a vehicle for a trivial fix.

Comment on lines +7 to +8
gssapi_rule.cc
logger.cc
Copy link
Member Author

Choose a reason for hiding this comment

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

v::security_config also fills a role as a sort of v::security_common

dotnwat added 3 commits July 2, 2024 22:35
v::config depends on v::security_config which is composed of
config_bsl/rcl.cc one which include gssapi_principal_mapper.h which in
turn depends on config headers for things like config::binding, creating
a circular dependency on headers.

this commit splits out gssapi_rule which is the only type needed by
v::config and doesn't have dependences on any config headers.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Before this change oidc_principal_mapping parsing and application from
jwt to acl_principal were combined into one unit. However, v::config
needs the parsing component to perform validation, but doesn't want to
take on all of the transitive dependencies that come from acl.h etc...

So we split out the parsing component and add a helper to handle the
final apply logic.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Depending on gssapi_principal_mapper.h for this meant bringing in
config::binding dependency. but that is unnecessary after this commit
moves the declaration into config.h.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Copy link
Member

@BenPope BenPope left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

@dotnwat dotnwat merged commit 93474b7 into redpanda-data:dev Jul 3, 2024
18 checks passed
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