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

Add Provider and UsernameLower #4

Merged
merged 5 commits into from
Feb 26, 2020
Merged

Conversation

madsi1m
Copy link

@madsi1m madsi1m commented Feb 17, 2020

No description provided.

@labkode
Copy link
Owner

labkode commented Feb 18, 2020

@madsi1m maybe those tests can be done solely by using the builtin functions available in this library:

http://masterminds.github.io/sprig/

The template will support any of the functions available in that library and I'm sure the lib contains functions to split strings and also to lower case a string

@madsi1m
Copy link
Author

madsi1m commented Feb 18, 2020

Wow so much choice in sprig, love it.

I guess for Provider i could use {{ (split \"@\" .Username)._1 }} but looks like a mess and doesn't account for when a username isn't and email, so kept Provider I rather have our reva config files easy to read

@labkode
Copy link
Owner

labkode commented Feb 24, 2020

@madsi1m One questions before merging: the Provider comes from the User struct in the UserId.IdP fields, which is usually the Provider (cern.ch/auth/realm) for example.

Your use case is that the "username" is given like "peter@university.com" right?

@madsi1m
Copy link
Author

madsi1m commented Feb 24, 2020

@labkode in our case the idp is actually our simplesamlphp instance and our usernames are emails.
So in our case UserId.IdP is always the same for all users.

@labkode
Copy link
Owner

labkode commented Feb 25, 2020

@madsi1m so as you deal with emails as usernames, then I propose you the following:

A mail like peter@example.org consists of:

  • local-part: peter
  • domain: example.org

Can you add a new Email field to the struct:

type UserData struct {
	*userpb.User
	Email EmailData 
}

type EmailData struct {
  Local string 
  Domain string
}

@madsi1m
Copy link
Author

madsi1m commented Feb 25, 2020

@labkode good idea, committed

@labkode labkode merged commit b0e0528 into labkode:fix-home-layout Feb 26, 2020
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.

2 participants