-
Notifications
You must be signed in to change notification settings - Fork 158
multi-tenancy: Optional attributes on provision API #1663
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
Conversation
It's already optional in the spec. For mulit-tenant provisioning we want it to be optional as well. Related: opencloud-eu#1597
| school.SetDisplayName(displayName) | ||
|
|
||
| if id == "" || displayName == "" { | ||
| i.logger.Warn().Str("dn", e.DN).Str("id", id).Str("displayName", displayName).Msg("Invalid School. Missing required attribute") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just out of curiosity, why do we use the Warn() log level?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. I didn't change that so it was added quite a while ago. I guess we could lower it to Info or even Debug because it's not really an error, but just caused by a user sending an invalid request.
Which one would you prefer?
| case nil: | ||
| logger.Debug().Err(errSchoolNumberExists).Str("schoolNumber", school.GetSchoolNumber()).Msg("duplicate school number") | ||
| return nil, errSchoolNumberExists | ||
| case ErrNotFound: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
errors.Is(err, ErrNotFound)
For the provisioning API we want the
schoolNumberattribute to be optional for a new School/Tenant. Also the user attributesprimaryRoleandidentitiesare made optional. See #1597