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

make Provisioning API aware of multiple mails #27474

Merged
merged 15 commits into from
Jun 30, 2021
Merged

Conversation

blizzz
Copy link
Member

@blizzz blizzz commented Jun 11, 2021

This extends the provisioning API as following

getUser

endpoint: ocs/v2.php/cloud/users/2d42e983-a7a8-40b1-8e4a-b8afeb5244240b

Original response

<?xml version="1.0"?>
<ocs>
 <meta>…</meta>
 <data>
  …
  <email>[email protected]</email>
  <displayname>Isabel, Morgan (person_11)</displayname>
  …
 </data>
</ocs>

New, with no additional mail set

…
  <email>[email protected]</email>
  <additional_mail/>
  <displayname>Isabel, Morgan (person_11)</displayname>
…

New, with one or more additional mail set

…
  <email>[email protected]</email>
  <additional_mail>
   <element>[email protected]</element>
   <element>[email protected]</element>
   <element>[email protected]</element>
  </additional_mail>
  <displayname>Isabel, Morgan (person_11)</displayname>
…

getEditableFields(ForUser)

endpoint: ocs/v2.php/cloud/user/fields/e8a7e882-5c5e-4f61-b6bb-bc5fd9b3cb4b

one entry added unconditionally

<?xml version="1.0"?>
<ocs>
 <meta>… </meta>
 <data>
  …
  <element>additional_mail</element>
  …
 </data>
</ocs>

editUser

endpoint: ocs/v2.php/cloud/users/2d42e983-a7a8-40b1-8e4a-b8afeb5244240b
method: PUT

  • To add an additional email, just use 'additional_mail' as key.

  • Deleting and setting scope is not possible with this endpoint as we need the value as reference.

editUserMultiValue

endpoint: ocs/v2.php/cloud/users/2d42e983-a7a8-40b1-8e4a-b8afeb5244240b/{collectionName}
method: PUT

  • To remove a value, assign the email to the key parameter and leave the value empty. Future properties may implement renaming by using key as old value and value as new value.
  • To set the scope, append the Scope suffix to the collectionName. key is the mail address, value the scope value.

contributes to #26866

@blizzz blizzz requested review from Pytal and skjnldsv June 11, 2021 11:41
@blizzz blizzz added this to the Nextcloud 22 milestone Jun 11, 2021
@blizzz blizzz added 2. developing Work in progress enhancement labels Jun 11, 2021
@blizzz blizzz force-pushed the feat/26866/prov-api branch 2 times, most recently from e3eaac3 to 84d1cd2 Compare June 11, 2021 14:14
@blizzz blizzz force-pushed the feat/26866/prov-api branch 2 times, most recently from 3f5a7b0 to 3637af2 Compare June 14, 2021 11:05
@skjnldsv skjnldsv removed their request for review June 14, 2021 12:13
@skjnldsv

This comment has been minimized.

@blizzz blizzz force-pushed the feat/26866/prov-api branch 2 times, most recently from fb905d4 to ee5b4ac Compare June 22, 2021 16:23
@blizzz blizzz mentioned this pull request Jun 23, 2021
39 tasks
@blizzz blizzz modified the milestones: Nextcloud 22, Nextcloud 23 Jun 24, 2021
@blizzz blizzz force-pushed the feat/26866/prov-api branch 3 times, most recently from e33d30a to 3561025 Compare June 25, 2021 19:40
@Pytal

This comment has been minimized.

@blizzz

This comment has been minimized.

@Pytal

This comment has been minimized.

- format as stored previously in oc_accounts table is kept

Signed-off-by: Arthur Schiwon <[email protected]>
Signed-off-by: Arthur Schiwon <[email protected]>
Signed-off-by: Arthur Schiwon <[email protected]>
- fixes wrong veriable usage also

Signed-off-by: Arthur Schiwon <[email protected]>
@blizzz blizzz marked this pull request as ready for review June 29, 2021 22:50
@blizzz blizzz added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jun 29, 2021
Signed-off-by: Arthur Schiwon <[email protected]>
Copy link
Member

@Pytal Pytal left a comment

Choose a reason for hiding this comment

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

🎉🎉🎉

@skjnldsv skjnldsv merged commit 9124c69 into master Jun 30, 2021
@skjnldsv skjnldsv deleted the feat/26866/prov-api branch June 30, 2021 05:13
@skjnldsv
Copy link
Member

/backport to stable22

@Pytal Pytal mentioned this pull request Jul 1, 2021
9 tasks
@blizzz blizzz added the pending documentation This pull request needs an associated documentation update label Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement pending documentation This pull request needs an associated documentation update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants