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

Ability to add NAS Identifier attribute to radius request #5465

Merged
merged 1 commit into from
Oct 18, 2018

Conversation

DrGonzo
Copy link
Contributor

@DrGonzo DrGonzo commented Oct 4, 2018

No description provided.

@DrGonzo
Copy link
Contributor Author

DrGonzo commented Oct 16, 2018

In our company we use Radius NAS Identifier attribute to access control in different teams. It would be nice if you accept PR.

@DrGonzo DrGonzo changed the title ability to add NAS Identifier header to radius request Ability to add NAS Identifier attribute to radius request Oct 16, 2018
@jefferai
Copy link
Member

@DrGonzo we'll get to it, don't worry :-)

@jefferai jefferai added this to the 0.12 milestone Oct 16, 2018
@@ -144,6 +144,9 @@ func (b *backend) RadiusLogin(ctx context.Context, req *logical.Request, usernam
packet := radius.New(radius.CodeAccessRequest, []byte(cfg.Secret))
UserName_SetString(packet, username)
UserPassword_SetString(packet, password)
if cfg.NasIdentifier != "" {
NASIdentifier_AddString(packet, cfg.NasIdentifier)
Copy link
Member

Choose a reason for hiding this comment

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

Given that some of the other variables are choosing Set functions, is there a reason for choosing NASIdentifier_AddString over NASIdentifier_SetString? Will adding allocate the space needed?

Copy link
Member

Choose a reason for hiding this comment

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

Using Add allows multiple. I don't think it matters here though since we're only supporting a single identifier (at least for now). But if we ever supported more than one we'd need to iterate over and use Add, so makes sense to keep it in for now I think.

Copy link
Member

@vishalnayak vishalnayak left a comment

Choose a reason for hiding this comment

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

One comment. Otherwise LGTM!

@vishalnayak
Copy link
Member

@meirish Could you please 👍 the JS changes?

@jefferai
Copy link
Member

I actually asked him the other day out-of-band and he said they were good.

@jefferai jefferai merged commit bad2f6d into hashicorp:master Oct 18, 2018
@jefferai jefferai modified the milestones: 0.12, 0.11.4 Oct 22, 2018
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