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

Manage DNF module for mod_auth_openidc #2283

Merged

Conversation

ekohl
Copy link
Collaborator

@ekohl ekohl commented Aug 9, 2022

On EL 8 mod_auth_openidc is in a DNF module that must be enabled. Otherwise the package is uninstallable. This is verified by adding an acceptance test for the class.

The inheritance on apache::params is removed since it was redundant. That is only needed if a class parameter uses apache::params.

$oidc_settings on apache::vhost is changed to have a default. The template expects one and With that it's impossible to miscompile. The alternative is to implement a fail() inside the code if it is empty, but this provides some safety.

@ekohl ekohl force-pushed the add-mod_auth_openidc-acceptance-test branch 2 times, most recently from aa66074 to b4ac0d7 Compare August 9, 2022 10:49
@ekohl
Copy link
Collaborator Author

ekohl commented Aug 9, 2022

Odd thing: why is it running acceptance tests on Scientific 6 (which is EOL since 2020) but not on Red Hat 6?

@ekohl ekohl force-pushed the add-mod_auth_openidc-acceptance-test branch from b4ac0d7 to 07292d2 Compare August 9, 2022 10:56
@ekohl ekohl marked this pull request as ready for review August 9, 2022 11:18
@ekohl ekohl requested a review from a team as a code owner August 9, 2022 11:18
@ekohl
Copy link
Collaborator Author

ekohl commented Aug 9, 2022

I think this is now ready. It's starting to look greener and greener in the checks.

@ekohl ekohl added the feature label Aug 9, 2022
bastelfreak
bastelfreak previously approved these changes Aug 9, 2022
@ekohl ekohl changed the title Add acceptance test for mod_auth_openidc Manage DNF module for mod_auth_openidc Aug 9, 2022
#
class apache::mod::auth_openidc inherits apache::params {
class apache::mod::auth_openidc (
Boolean $manage_dnf_module = $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '8',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note that EL9 doesn't have this in a module, so it's limited to EL8.

#
class apache::mod::auth_openidc inherits apache::params {
class apache::mod::auth_openidc (
Boolean $manage_dnf_module = $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '8',
Copy link
Contributor

Choose a reason for hiding this comment

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

This is correct, because while EL9 has module support, mod_auth_oidc is not modular there.
(:exploding_head:)

evgeni
evgeni previously approved these changes Aug 9, 2022
@ekohl ekohl dismissed stale reviews from evgeni and bastelfreak via fcf1ea1 August 9, 2022 11:23
@ekohl ekohl force-pushed the add-mod_auth_openidc-acceptance-test branch from 07292d2 to fcf1ea1 Compare August 9, 2022 11:23
@ekohl
Copy link
Collaborator Author

ekohl commented Aug 9, 2022

I just pushed an update that added a unit test to ensure the DNF module isn't present on non-EL8.

@ekohl
Copy link
Collaborator Author

ekohl commented Aug 9, 2022

The RHEL 9 failure looks like an intermittent failure on provisioning the machine. It passed previously and Puppet 7 is green. Shouldn't be blocking.

@ekohl
Copy link
Collaborator Author

ekohl commented Aug 10, 2022

Something @evgeni and I were discussing, does this module also need an include on authn_core so you can use AuthType if you disable default mods? mod_auth_gssapi does that at least:

include apache::mod::authn_core

@asieraguado you added the class initially, perhaps you can weigh in?

@asieraguado
Copy link
Contributor

Something @evgeni and I were discussing, does this module also need an include on authn_core so you can use AuthType if you disable default mods? mod_auth_gssapi does that at least:

include apache::mod::authn_core

@asieraguado you added the class initially, perhaps you can weigh in?

Sorry, I didn't check if the module works without authn_core, but probably it's better to have the include. Some other auth modules don't have it, for example auth_mellon. Maybe it is needed in all of them?

@evgeni
Copy link
Contributor

evgeni commented Aug 10, 2022

Yeah, I think it's needed for all of them, as without authn_core there is no AuthType directive in the config, so even if the specific auth module itself is loadable (which I think it is), it can't be selected to be used for authentication.

@ekohl
Copy link
Collaborator Author

ekohl commented Aug 10, 2022

I think it's needed for all of them

Are we talkin about manifests/mod/auth_*.pp now?

The authn_core module is needed for AuthType, which is needed to select
a specific auth. While modules may load without them, it's unlikely to
work in practice.

This is only relevant when default mods are disabled since authn_core is
a default module.
On EL 8 mod_auth_openidc is in a DNF module that must be enabled.
Otherwise the package is uninstallable. This is verified by adding an
acceptance test for the class.

The inheritance on apache::params is removed since it was redundant.
That is only needed if a class parameter uses apache::params.

$oidc_settings on apache::vhost is changed to have a default. The
template expects one and With that it's impossible to miscompile. The
alternative is to implement a fail() inside the code if it is empty, but
this provides some safety.
@ekohl ekohl force-pushed the add-mod_auth_openidc-acceptance-test branch from fcf1ea1 to 8417c0b Compare August 10, 2022 11:57
@evgeni
Copy link
Contributor

evgeni commented Aug 10, 2022

I think it's needed for all of them

Are we talkin about manifests/mod/auth_*.pp now?

Technically manifests/mod/auth_*.pp, manifests/mod/authn_*.pp, manifests/mod/authnz_*.pp?

@ekohl
Copy link
Collaborator Author

ekohl commented Aug 11, 2022

@david22swan thoughts? Ideally we would also get a release out soon with this.

Also, you don't do stable branches, right? Ideally we'd get this into a 7.x release as well.

Copy link
Member

@david22swan david22swan left a comment

Choose a reason for hiding this comment

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

LGTM

Changes look goo and I don't see anything that stands out as needing a fix so would be happy to merge.

@ekohl
Copy link
Collaborator Author

ekohl commented Aug 11, 2022

Technically manifests/mod/auth_*.pp, manifests/mod/authn_*.pp, manifests/mod/authnz_*.pp?

I'd prefer to keep that for a future PR.

Can we merge this then? Ideally also get a release out (with the other fixes for which PRs are open now).

@evgeni
Copy link
Contributor

evgeni commented Aug 11, 2022

Technically manifests/mod/auth_*.pp, manifests/mod/authn_*.pp, manifests/mod/authnz_*.pp?

I'd prefer to keep that for a future PR.

Sure, that's mostly unrelated to the changes in this PR, just something that I started thinking of because of this PR ;)

@david22swan
Copy link
Member

Ok, everyone sounds happy so gonna go ahead and merge

@david22swan david22swan merged commit 2603379 into puppetlabs:main Aug 11, 2022
@ekohl ekohl deleted the add-mod_auth_openidc-acceptance-test branch August 11, 2022 13:43
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.

6 participants