Merge pull request #10061 from owncloud/checkEmailWhileGeneratetoken

check email validation
This commit is contained in:
Viktor Scharf
2024-09-16 11:57:58 +02:00
committed by GitHub
3 changed files with 22 additions and 13 deletions

View File

@@ -70,8 +70,12 @@ class OcmContext implements Context {
/**
* @return string
* @throws Exception
*/
public function getLastFederatedInvitationToken():string {
if (empty($this->invitationToken)) {
throw new Exception(__METHOD__ . " token not found");
}
return $this->invitationToken;
}
@@ -107,8 +111,6 @@ class OcmContext implements Context {
$responseData = \json_decode($response->getBody()->getContents(), true, 512, JSON_THROW_ON_ERROR);
if (isset($responseData["token"])) {
$this->invitationToken = $responseData["token"];
} else {
throw new Exception(__METHOD__ . " response doesn't contain token");
}
return $response;
}

View File

@@ -259,10 +259,6 @@ The expected failures in this file are from features in the owncloud/ocis repo.
- [apiOcm/share.feature:12](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L12)
- [apiOcm/share.feature:91](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L91)
#### [OCM. user cannot see invite description and inviteUser email](https://github.com/owncloud/ocis/issues/9591)
- [apiOcm/createInvitation.feature:63](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/createInvitation.feature#L63)
#### [OCM. admin cannot get federated users if he hasn't connection with them ](https://github.com/owncloud/ocis/issues/9829)
tests/acceptance/features/apiOcm/searchFederationUsers.feature

View File

@@ -60,7 +60,7 @@ Feature: create invitation
"""
@issue-9591
Scenario: user creates invitation with email and description
Scenario: user creates invitation with valid email and description
Given using server "LOCAL"
When "Alice" creates the federation share invitation with email "brian@example.com" and description "a share invitation from Alice"
Then the HTTP status code should be "200"
@@ -71,8 +71,7 @@ Feature: create invitation
"required": [
"expiration",
"token",
"description",
"recipient"
"description"
],
"properties": {
"expiration": {
@@ -85,9 +84,6 @@ Feature: create invitation
},
"description": {
"const": "a share invitation from Alice"
},
"description": {
"const": "brian@example.com"
}
}
}
@@ -124,7 +120,21 @@ Feature: create invitation
}
"""
@email
Scenario Outline: user creates invitation with valid/invalid email
Given using server "LOCAL"
When "Alice" creates the federation share invitation with email "<email>" and description "a share invitation from Alice"
Then the HTTP status code should be "<code>"
Examples:
| email | code |
| user@subdomain.example.longdomain | 200 |
| user.bob+123@domain.test-123.com | 200 |
| user.example.com | 400 |
| user@.com | 400 |
| @domain.com | 400 |
| user@domain..com | 400 |
@email @skip
Scenario: federated user gets an email notification if their email was specified when creating the federation share invitation
Given using server "LOCAL"
When "Alice" has created the federation share invitation with email "brian@example.com" and description "a share invitation from Alice"
@@ -133,6 +143,7 @@ Feature: create invitation
Hi,
Alice Hansen (alice@example.org) wants to start sharing collaboration resources with you.
Please visit your federation provider and use the following details:
Token: %fed_invitation_token%
ProviderDomain: https://ocis-server:9200