-
Notifications
You must be signed in to change notification settings - Fork 17
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
[full-ci] Expose group's displayname #748
Conversation
💥 Acceptance tests pipeline apiProvisioningLDAP-master-mysql8.0-php7.3 failed. The build has been cancelled. |
48b2bc9
to
b86e444
Compare
We need to decide if we raise the minimum version or not. The code is technically compatible with previous core versions, but by default it will show the uuid of the group which will look ugly. We'll need to verify, but the cases should be:
The cases to check are the second and third. Second case looks ugly, but it should work. Note that OC 10.10 doesn't show the displayname of the group in most cases. In addition, we've added caching for the group details. You might need to clear the cache (if it's being used) for the changes to appear. |
17f6c75
to
4f0d1dd
Compare
@phil-davis I think we'll need to adjust the tests here. The provisioning API uses the gid, which is mapped to the entryuuid by default in this PR. |
@@ -290,6 +290,14 @@ | |||
<input type="text" id="ldap_expert_username_attr" name="ldap_expert_username_attr" data-default="<?php p($_['ldap_expert_username_attr_default']); ?>" /> | |||
</div> | |||
</section> | |||
<section> | |||
<h3><?php p($l->t('Internal Groupname')); ?></h3> | |||
<p><?php p($l->t('The internal groupname is used to uniquely identify the group. It has the same restrictions as the internal username, in particular, the group name must be immutable and unique. By default, the UUID will be used. This internal groupname won\'t likely by visible because a displayname attribute is intended to be used to show the group.')); ?></p> |
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.
"It has the same restrictions as the internal username" - but probably a larger set of characters will work.
Do we try to say what characters are allowed?
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.
The internal username has a-zA-Z0-9+_.@-
explicitly written, so those should be ok.
As you've said, a larger char set will likely work, but to keep it on the safe side, I'd rather keep the char set small so we don't face issues with weird chars.
The main idea is that it will behave the same way as the internal username, so it makes sense to have the same restrictions. We might want to include the whitespace explicitly in the char set because it's a common char, but other than that, I think it's fine as it is.
The core daily-master-qa tarball was a week out of date. That was noticed today and it has been recreated a few hours ago. So it now has the latest code from core master, including from PR owncloud/core#40229 So I restarted CI just now. That will get a fresh result, and then I will look at what tests fail and how we can fix them. |
@jvillafanez see my comment #749 (comment) There is a problem with group names that have "special characters" in them. Probably the group id or display name needs some escaping somewhere in the code - can you have a look? I adjusted the test settings in commit 8ba4029 - now it defines For installation that are already set up, the migration code should work nicely. For new installations, When we get all the tests passing, then I can sort out some scenarios in a separate test suite that has the group id and group display name different. |
It should be already defaulting to the entryuuid (or any other uuid attribute) of the group. The behavior should be the same as with the username. |
I pushed commit 8b21e28 to my test branch. That seems to happen because |
It might be better to return null if the displayname isn't found and let core handle it.
|
core owncloud/core#40261 refactored And some of my comments in 8b21e28 are also now out-of-date. So yes, add your suggestion to return null if the display name is not found, if you like. Then I think that this PR is ready. |
520190c
to
11b1598
Compare
Kudos, SonarCloud Quality Gate passed! |
Notes to self:
|
dba1e74
to
cf0ba4a
Compare
Is there anything open here? /cc @enbrnz |
Maybe QA can confirm if we should rise the minimum version to 10.12 due to owncloud/core#40412 . Other than that, I think @mrow4a needs to give the green light |
0de6236
to
7231951
Compare
Kudos, SonarCloud Quality Gate passed! |
I think #748 (comment) still applies. Options are:
Note that the problem only happens in new installations. There is a migration in this PR in so the updates will keep the current behavior. |
@jvillafanez @cdamken I think the option agreed was no. 1 -> release new user_ldap that includes this PR AFTER oc10.12 is released. If there is corner case customer (with new instalation on oc10.11) like you explained, we would just recommend to upgrade to oc10.12 to have this feature on new user_ldap working. I think raising minimal version is a bit too much here. |
I do agree with @mrow4a's comment, probably raising core minimum version is too much and be sure to release user_ldap 0.17.0 after next core version + properly document this should be already enough.
|
@jvillafanez GitHub is reporting conflicts in |
7231951
to
6a44b84
Compare
Conflicts in the info.xml were due to the different app version. I've set the version to 0.17.0 because we'll have to run the migration included in the PR and I'm not sure if it would run with just a minor version update. |
Kudos, SonarCloud Quality Gate passed! |
38264f5
to
f804a03
Compare
Kudos, SonarCloud Quality Gate passed! |
Expose the group's displayname and store the group id in the "owncloud_name" column of the "oc_ldap_group_mapping" table.
For new installations
By default, the "owncloud_name" will likely be entryuuid (at least checked with openldap, need to test with more providers). This will guarantee uniqueness. The default displayname will still be the cn.
TODO (in this PR):
a-zA-Z0-9+_.@-
chars allowedRef: https://github.com/owncloud/enterprise/issues/5071