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

Allow the email address to be cleared via the Provisioning API #37427

Merged
merged 1 commit into from
May 22, 2020

Conversation

phil-davis
Copy link
Contributor

@phil-davis phil-davis commented May 21, 2020

Description

The Provisioning API would not allow the email address of a user to be cleared (set to the empty string - see linked issue). This PR allows the email address to be set to the empty string, so that email addresses can be cleared by suitably-privileged users.

Note: this will also be handy to have for acceptance tests - it will be possible to easily and programmatically reset a test user email address back to its "default" value, which is "no email address"

Related Issue

Part of #37424

How Has This Been Tested?

CI and local curl requests to the Provisioning API:

$ curl -X PUT http://phil:[email protected]:8080/ocs/v2.php/cloud/users/phil -d key="email" -d value="[email protected]"
<?xml version="1.0"?>
<ocs>
 <meta>
  <status>ok</status>
  <statuscode>200</statuscode>
  <message/>
 </meta>
 <data/>
</ocs>
$ php occ user:list -a email
  - admin: [email protected]
  - phil: [email protected]
$ curl -X PUT http://phil:[email protected]:8080/ocs/v2.php/cloud/users/phil -d key="email" -d value=""
<?xml version="1.0"?>
<ocs>
 <meta>
  <status>ok</status>
  <statuscode>200</statuscode>
  <message/>
 </meta>
 <data/>
</ocs>
$ php occ user:list -a email
  - admin: [email protected]
  - phil: 

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:
  • Changelog item, see TEMPLATE

@phil-davis phil-davis force-pushed the clear-email-using-provisioning-api branch from f84292c to 52b1b8e Compare May 21, 2020 12:01
@codecov
Copy link

codecov bot commented May 21, 2020

Codecov Report

Merging #37427 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #37427   +/-   ##
=========================================
  Coverage     64.61%   64.61%           
- Complexity    19254    19255    +1     
=========================================
  Files          1270     1270           
  Lines         75262    75263    +1     
  Branches       1331     1331           
=========================================
+ Hits          48628    48629    +1     
  Misses        26242    26242           
  Partials        392      392           
Flag Coverage Δ Complexity Δ
#javascript 54.14% <ø> (ø) 0.00 <ø> (ø)
#phpunit 65.77% <100.00%> (+<0.01%) 19255.00 <0.00> (+1.00)
Impacted Files Coverage Δ Complexity Δ
apps/provisioning_api/lib/Users.php 90.57% <100.00%> (+0.03%) 123.00 <0.00> (+1.00)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b4739a2...52b1b8e. Read the comment docs.

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.

2 participants