Skip to content

Conversation

@rhafer
Copy link
Contributor

@rhafer rhafer commented Oct 14, 2025

For the provisioning API we want the schoolNumber attribute to be optional for a new School/Tenant. Also the user attributes primaryRole and identities are made optional. See #1597

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")
Copy link
Contributor

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?

Copy link
Contributor Author

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:
Copy link
Contributor

Choose a reason for hiding this comment

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

errors.Is(err, ErrNotFound)

@rhafer rhafer merged commit e244169 into opencloud-eu:main Oct 28, 2025
59 checks passed
@openclouders openclouders mentioned this pull request Oct 28, 2025
1 task
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.

3 participants