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

Allow the same attribute to be configured several times #49

Open
cornelinux opened this issue Apr 20, 2021 · 1 comment
Open

Allow the same attribute to be configured several times #49

cornelinux opened this issue Apr 20, 2021 · 1 comment
Assignees
Labels

Comments

@cornelinux
Copy link
Member

In many scenarios it can be necessary to configure the same attribute several times:

[Attribute Filter-Id]
dir = user
userAttribute = gruppen
regex = CN=Enterprise\ Admins,CN=Users,DC=testfoo,DC=intranet
prefix = FIX-BUILTIN-Enter

[Attribute Filter-Id]
dir = user
userAttribute = gruppen
regex = CN=Administrators,CN=Builtin,DC=testfoo,DC=intranet
prefix = FIX-BUILTIN-admins

In this case we would set Filter-Id to one constant value if a group is given and to another fixed value if another group is given.

The problem is, that due to the perl parser Config::Inifiles the two sections are merged togeather. So either we need to completeley change the way the sections are configured or we need to differ the sections by different names.

A simple way to achieve this is to add a tag to the sections, that helps to keep the sections destinct but ignore it during our parsing:

[Attribute Filter-Id A]
dir = user
userAttribute = gruppen
regex = CN=Enterprise\ Admins,CN=Users,DC=testfoo,DC=intranet
prefix = FIX-BUILTIN-Enter

[Attribute Filter-Id B]
dir = user
userAttribute = gruppen
regex = CN=Administrators,CN=Builtin,DC=testfoo,DC=intranet
prefix = FIX-BUILTIN-admins
@cornelinux cornelinux self-assigned this Apr 20, 2021
@cornelinux
Copy link
Member Author

This is already possible:

[Attribute Something1]
dir = user
userAttribute = gruppen
radiusAttribute = Filter-Id
regex = CN=Enterprise\ Admins,CN=Users,DC=testfoo,DC=intranet
prefix = FIX-BUILTIN-Enter

[Attribute SOmething-Else]
dir = user
userAttribute = gruppen
radiusAttribute = Filter-Id
regex = CN=Administrators,CN=Builtin,DC=testfoo,DC=intranet
prefix = FIX-BUILTIN-admins

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant