Files

713 lines
20 KiB
Gherkin
Raw Permalink Normal View History

2024-07-03 22:24:14 +02:00
@ocm
Feature: search federation users
As a user
I can find federation users after accepting an invitation to share resources
2024-07-08 08:18:27 +02:00
2024-07-03 22:24:14 +02:00
Background:
Given these users have been created with default attributes:
2024-07-03 22:24:14 +02:00
| username |
| Alice |
| Carol |
And using server "REMOTE"
And user "Brian" has been created with default attributes
2024-07-03 22:24:14 +02:00
2024-12-03 17:30:01 +05:45
@issue-9813
2024-07-03 22:24:14 +02:00
Scenario: users search for federation users by display name
Given using server "LOCAL"
And "Alice" has created the federation share invitation
And using server "REMOTE"
And "Brian" has accepted invitation
When user "Brian" searches for federated user "ali" using Graph API
2024-07-03 22:24:14 +02:00
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"displayName",
2024-08-14 16:38:42 +02:00
"id",
"userType",
"identities"
2024-07-03 22:24:14 +02:00
],
"properties": {
"displayName": {
"const": "Alice Hansen"
},
"id": {
"type": "string",
2024-09-04 17:38:54 +02:00
"pattern": "^%federated_user_id_pattern%$"
2024-08-14 16:38:42 +02:00
},
"userType": {
"type": "string",
"const": "Federated"
},
"identities": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"issuer",
"issuerAssignedId"
],
"properties": {
"issuer": {
"const": "%local_base_url%"
2024-08-14 16:38:42 +02:00
},
"issuerAssignedId": {
"type": "string",
"pattern": "^%identities_issuer_id_pattern%$"
}
}
}
2024-07-03 22:24:14 +02:00
}
}
}
}
}
}
"""
And using server "LOCAL"
When user "Alice" searches for federated user "bri" using Graph API
2024-07-03 22:24:14 +02:00
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"displayName",
2024-08-14 16:38:42 +02:00
"id",
"userType",
"identities"
2024-07-03 22:24:14 +02:00
],
"properties": {
"displayName": {
"const": "Brian Murphy"
},
"id": {
"type": "string",
2024-09-04 17:38:54 +02:00
"pattern": "^%federated_user_id_pattern%$"
2024-08-14 16:38:42 +02:00
},
"userType": {
"type": "string",
"const": "Federated"
},
"identities": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"issuer",
"issuerAssignedId"
],
"properties": {
"issuer": {
"const": "%remote_base_url%"
2024-08-14 16:38:42 +02:00
},
"issuerAssignedId": {
"type": "string",
"pattern": "^%identities_issuer_id_pattern%$"
}
}
}
2024-07-03 22:24:14 +02:00
}
}
}
}
}
}
"""
2024-12-03 17:30:01 +05:45
@issue-9813
2024-07-08 15:16:21 +02:00
Scenario: user search for federation users by email
2024-07-03 22:24:14 +02:00
Given using server "LOCAL"
And "Alice" has created the federation share invitation
And using server "REMOTE"
And "Brian" has accepted invitation
When user "Brian" searches for federated user "%22alice@example.org%22" using Graph API
2024-07-03 22:24:14 +02:00
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"displayName",
2024-08-14 16:38:42 +02:00
"id",
"userType",
"identities"
2024-07-03 22:24:14 +02:00
],
"properties": {
"displayName": {
"const": "Alice Hansen"
},
"id": {
"type": "string",
2024-09-04 17:38:54 +02:00
"pattern": "^%federated_user_id_pattern%$"
2024-08-14 16:38:42 +02:00
},
"userType": {
"type": "string",
"const": "Federated"
},
"identities": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"issuer",
"issuerAssignedId"
],
"properties": {
"issuer": {
"const": "%local_base_url%"
2024-08-14 16:38:42 +02:00
},
"issuerAssignedId": {
"type": "string",
"pattern": "^%identities_issuer_id_pattern%$"
}
}
}
2024-07-03 22:24:14 +02:00
}
}
}
}
}
}
"""
And using server "LOCAL"
When user "Alice" searches for federated user "%22brian@example.org%22" using Graph API
2024-07-03 22:24:14 +02:00
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"displayName",
2024-08-14 16:38:42 +02:00
"id",
"userType",
"identities"
2024-07-03 22:24:14 +02:00
],
"properties": {
"displayName": {
"const": "Brian Murphy"
},
"id": {
"type": "string",
2024-09-04 17:38:54 +02:00
"pattern": "^%federated_user_id_pattern%$"
2024-08-14 16:38:42 +02:00
},
"userType": {
"type": "string",
"const": "Federated"
},
"identities": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"issuer",
"issuerAssignedId"
],
"properties": {
"issuer": {
"const": "%remote_base_url%"
2024-08-14 16:38:42 +02:00
},
"issuerAssignedId": {
"type": "string",
"pattern": "^%identities_issuer_id_pattern%$"
}
}
}
2024-07-03 22:24:14 +02:00
}
}
}
}
}
}
"""
2024-08-14 16:38:42 +02:00
Scenario: users search for federation users without federated connection
2024-07-03 22:24:14 +02:00
Given using server "LOCAL"
And "Alice" has created the federation share invitation
And using server "REMOTE"
And "Brian" has accepted invitation
When user "Brian" searches for federated user "%22carol@example.org%22" using Graph API
2024-07-03 22:24:14 +02:00
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "array",
"minItems": 0,
"maxItems": 0
}
}
}
"""
And using server "LOCAL"
When user "Carol" searches for federated user "bria" using Graph API
2024-07-03 22:24:14 +02:00
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "array",
"minItems": 0,
"maxItems": 0
}
}
}
"""
2024-07-08 15:16:21 +02:00
Scenario: users search all federation users
Given using server "REMOTE"
And "Brian" has created the federation share invitation
And using server "LOCAL"
And "Alice" has accepted invitation
And "Carol" has accepted invitation
When "Alice" searches for accepted users
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"display_name",
"idp",
"user_id",
"mail"
],
"properties": {
"display_name": {
"type": "string",
"const": "Brian Murphy"
},
"idp": {
"type": "string",
"const": "%remote_base_url%"
2024-07-08 15:16:21 +02:00
},
"mail": {
"type": "string",
"pattern": "brian@example.org"
},
"user_id": {
"type": "string",
"pattern": "^%federated_user_id_pattern%$"
2024-07-08 15:16:21 +02:00
}
}
}
}
"""
When using server "REMOTE"
And "Brian" searches for accepted users
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "array",
"minItems": 2,
"maxItems": 2,
"uniqueItems": true,
"items": {
"oneOf": [
{
"type": "object",
"required": [
"display_name",
"idp",
"user_id",
"mail"
],
"properties": {
"display_name": {
"const": "Alice Hansen"
},
"idp": {
"const": "%local_base_url%"
2024-07-08 15:16:21 +02:00
},
"mail": {
"pattern": "alice@example.org"
},
"user_id": {
"type": "string",
"pattern": "^%federated_user_id_pattern%$"
2024-07-08 15:16:21 +02:00
}
}
},
{
"type": "object",
"required": [
"display_name",
"idp",
"user_id",
"mail"
],
"properties": {
"display_name": {
"const": "Carol King"
},
"idp": {
"const": "%local_base_url%"
2024-07-08 15:16:21 +02:00
},
"mail": {
"pattern": "carol@example.org"
},
"user_id": {
"type": "string",
"pattern": "^%federated_user_id_pattern%$"
2024-07-08 15:16:21 +02:00
}
}
}
]
}
}
"""
2024-08-14 16:38:42 +02:00
@issue-9829
Scenario: admin gets federated users
Given using server "LOCAL"
And "Alice" has created the federation share invitation
And using server "REMOTE"
And "Brian" has accepted invitation
When the administrator gets federated users using the Graph API
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"displayName",
"id",
"mail",
"userType",
"identities"
],
"properties": {
"displayName": {
"const": "Alice Hansen"
},
"id": {
"type": "string",
2024-09-04 17:38:54 +02:00
"pattern": "^%federated_user_id_pattern%$"
2024-08-14 16:38:42 +02:00
},
"mail": {
"const": "alice@example.org"
},
"userType": {
"const": "Federated"
},
"identities": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"issuer",
"issuerAssignedId"
],
"properties": {
"issuer": {
"const": "%local_base_url%"
2024-08-14 16:38:42 +02:00
},
"issuerAssignedId": {
"type": "string",
"pattern": "^%identities_issuer_id_pattern%$"
}
}
}
}
}
}
}
}
}
"""
And using server "LOCAL"
When the administrator gets federated users using the Graph API
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"displayName",
"id",
"mail",
"userType",
"identities"
],
"properties": {
"displayName": {
"const": "Brian Murphy"
},
"id": {
"type": "string",
2024-09-04 17:38:54 +02:00
"pattern": "^%federated_user_id_pattern%$"
2024-08-14 16:38:42 +02:00
},
"mail": {
"const": "brian@example.org"
},
"userType": {
"const": "Federated"
},
"identities": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"issuer",
"issuerAssignedId"
],
"properties": {
"issuer": {
"const": "%remote_base_url%"
2024-08-14 16:38:42 +02:00
},
"issuerAssignedId": {
"type": "string",
"pattern": "^%identities_issuer_id_pattern%$"
}
}
}
}
}
}
}
}
}
"""
Scenario: user without admin permissions cannot get federated users
Given using server "LOCAL"
And "Alice" has created the federation share invitation
And using server "REMOTE"
And "Brian" has accepted invitation
And using server "LOCAL"
When user "Carol" tries to get federated users using the Graph API
Then the HTTP status code should be "403"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"const": "accessDenied"
},
"message": {
"const": "search term too short"
}
}
}
}
}
"""
@issue-9829
2024-08-19 11:11:17 +02:00
Scenario: admin gets federated and local users
2024-08-14 16:38:42 +02:00
Given using server "LOCAL"
And "Alice" has created the federation share invitation
And using server "REMOTE"
And "Brian" has accepted invitation
And using server "LOCAL"
2024-08-19 11:11:17 +02:00
When the administrator gets federated and local users using the Graph API
2024-08-14 16:38:42 +02:00
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "array",
"maxItems": 2,
"minItems": 2,
"uniqueItems": true,
"items": {
"oneOf": [
{
"type": "object",
"required": [
"accountEnabled",
"displayName",
"id",
"mail",
"onPremisesSamAccountName",
"surname",
"userType"
],
"properties": {
"accountEnabled": {
"const": true
},
"displayName": {
"const": "Carol King"
},
"id": {
"type": "string",
"pattern": "^%user_id_pattern%$"
},
"mail": {
"const": "carol@example.org"
},
"onPremisesSamAccountName": {
"const": "Carol"
},
"surname": {
"const": "Carol"
},
"userType": {
"const": "Member"
}
}
},
{
"type": "object",
"required": [
"displayName",
"id",
"mail",
"userType",
"identities"
],
"properties": {
"displayName": {
"const": "Brian Murphy"
},
"id": {
"type": "string",
2024-09-04 17:38:54 +02:00
"pattern": "^%federated_user_id_pattern%$"
2024-08-14 16:38:42 +02:00
},
"mail": {
"const": "brian@example.org"
},
"userType": {
"const": "Federated"
},
"identities": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"issuer",
"issuerAssignedId"
],
"properties": {
"issuer": {
"const": "%remote_base_url%"
2024-08-14 16:38:42 +02:00
},
"issuerAssignedId": {
"type": "string",
"pattern": "^%identities_issuer_id_pattern%$"
}
}
}
}
}
}
]
}
}
}
}
"""
2024-07-08 15:16:21 +02:00
# TODO try to find federation users after deleting federated conection