-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consumer Api: Deletion of Files, Tokens and Relationship Templates (#934
) * feat: Add file deletion command, handler, repository and controller * feat: Add file deletion command to Consumer Api SDK * feat: Add file deletion command to bruno * feat: Add command, handler and repository method for delete token endpoint * feat: Add delete token endpoint to bruno and consumer api sdk * feat: Migrate DB to make relationship template nullable in relationship * feat: Make Relationship Template nullable in Relationship * feat: Add controller, command, handler, validator, sdk method and bruno file for relationship template deletion * chore: Add user b to bruno variables and update passwords * chore: Add/update bruno files for multiple relationship endpoints * chore: Make relationship template nullable in sdk types * test: Add integration test for relationship template deletion * chore: Add tests for deletion, rewrite existing ones, refactor backing code * chore: Switch order for file deletion * chore: Move owner checks to domain classes and rewrite domain exceptions * chore: Add unit tests for deletion check functions * chore: Change function and variable names to comply with convention * chore: Simplify used test functions * chore: Simplify test function --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
5ddcd95
commit 5bf1ab0
Showing
76 changed files
with
1,601 additions
and
44 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
Applications/ConsumerApi/src/http/Authorization/Get OAuth Token (B).bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
meta { | ||
name: Get OAuth Token (B) | ||
type: http | ||
seq: 2 | ||
} | ||
|
||
post { | ||
url: {{auth.url}} | ||
body: formUrlEncoded | ||
auth: none | ||
} | ||
|
||
body:form-urlencoded { | ||
grant_type: password | ||
username: {{auth.username_b}} | ||
password: {{auth.password_b}} | ||
client_id: {{auth.client_id}} | ||
client_secret: {{auth.client_secret}} | ||
} | ||
|
||
vars:post-response { | ||
jwt.token: res.body.access_token | ||
jwt.expires_in: res.body.expires_in | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
meta { | ||
name: /Files/{id} | ||
type: http | ||
seq: 5 | ||
} | ||
|
||
delete { | ||
url: {{baseUrl}}/Files/{{id}} | ||
body: none | ||
auth: inherit | ||
} | ||
|
||
vars:pre-request { | ||
id: FILF5vUtJstbmLAr8A0z | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
Applications/ConsumerApi/src/http/RelationshipTemplates/Delete Relationship Template.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
meta { | ||
name: /RelationshipTemplates/{id} | ||
type: http | ||
seq: 4 | ||
} | ||
|
||
delete { | ||
url: {{baseUrl}}/RelationshipTemplates/{{id}} | ||
body: none | ||
auth: inherit | ||
} | ||
|
||
vars:pre-request { | ||
id: RLTpUznhYQsBse545qLZ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
Applications/ConsumerApi/src/http/Relationships/Actions/Accept Relationship.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
meta { | ||
name: /Relationships/{id}/Accept | ||
type: http | ||
seq: 1 | ||
} | ||
|
||
put { | ||
url: {{baseUrl}}/Relationships/{{id}}/Accept | ||
body: json | ||
auth: inherit | ||
} | ||
|
||
body:json { | ||
{ | ||
"creationResponseContent": "" | ||
} | ||
} | ||
|
||
vars:pre-request { | ||
id: RELquh4tVcr3zOTQGti7 | ||
} |
21 changes: 21 additions & 0 deletions
21
Applications/ConsumerApi/src/http/Relationships/Actions/Decompose Relationship.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
meta { | ||
name: /Relationships/{id}/Decompose | ||
type: http | ||
seq: 5 | ||
} | ||
|
||
put { | ||
url: {{baseUrl}}/Relationships/{{id}}/Decompose | ||
body: json | ||
auth: inherit | ||
} | ||
|
||
body:json { | ||
{ | ||
"creationResponseContent": "" | ||
} | ||
} | ||
|
||
vars:pre-request { | ||
id: REL8DyBnfWYiXCzxkMiv | ||
} |
21 changes: 21 additions & 0 deletions
21
Applications/ConsumerApi/src/http/Relationships/Actions/Reject Relationship.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
meta { | ||
name: /Relationships/{id}/Reject | ||
type: http | ||
seq: 2 | ||
} | ||
|
||
put { | ||
url: {{baseUrl}}/Relationships/{{id}}/Reject | ||
body: json | ||
auth: inherit | ||
} | ||
|
||
body:json { | ||
{ | ||
"creationResponseContent": "" | ||
} | ||
} | ||
|
||
vars:pre-request { | ||
id: REL8DyBnfWYiXCzxkMiv | ||
} |
21 changes: 21 additions & 0 deletions
21
Applications/ConsumerApi/src/http/Relationships/Actions/Revoke Relationship.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
meta { | ||
name: /Relationships/{id}/Revoke | ||
type: http | ||
seq: 3 | ||
} | ||
|
||
put { | ||
url: {{baseUrl}}/Relationships/{{id}}/Revoke | ||
body: json | ||
auth: inherit | ||
} | ||
|
||
body:json { | ||
{ | ||
"creationResponseContent": "" | ||
} | ||
} | ||
|
||
vars:pre-request { | ||
id: REL8DyBnfWYiXCzxkMiv | ||
} |
21 changes: 21 additions & 0 deletions
21
Applications/ConsumerApi/src/http/Relationships/Actions/Terminate Relationship.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
meta { | ||
name: /Relationships/{id}/Terminate | ||
type: http | ||
seq: 4 | ||
} | ||
|
||
put { | ||
url: {{baseUrl}}/Relationships/{{id}}/Terminate | ||
body: json | ||
auth: inherit | ||
} | ||
|
||
body:json { | ||
{ | ||
"creationResponseContent": "" | ||
} | ||
} | ||
|
||
vars:pre-request { | ||
id: REL8DyBnfWYiXCzxkMiv | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,5 +11,5 @@ get { | |
} | ||
|
||
vars:pre-request { | ||
RelationshipId: RELUY2h3HVSFfYkdli0P | ||
RelationshipId: RELquh4tVcr3zOTQGti7 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...ions/ConsumerApi/src/http/Relationships/Reactivation/Accept Relationship Reactivation.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
meta { | ||
name: /Relationships/{id}/Reactivate/Accept | ||
type: http | ||
seq: 2 | ||
} | ||
|
||
put { | ||
url: {{baseUrl}}/Relationships/{{id}}/Reactivate/Accept | ||
body: json | ||
auth: inherit | ||
} | ||
|
||
body:json { | ||
{ | ||
"creationResponseContent": "" | ||
} | ||
} | ||
|
||
vars:pre-request { | ||
id: REL8DyBnfWYiXCzxkMiv | ||
} |
21 changes: 21 additions & 0 deletions
21
Applications/ConsumerApi/src/http/Relationships/Reactivation/Reactivate Relationship.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
meta { | ||
name: /Relationships/{id}/Reactivate | ||
type: http | ||
seq: 1 | ||
} | ||
|
||
put { | ||
url: {{baseUrl}}/Relationships/{{id}}/Reactivate | ||
body: json | ||
auth: inherit | ||
} | ||
|
||
body:json { | ||
{ | ||
"creationResponseContent": "" | ||
} | ||
} | ||
|
||
vars:pre-request { | ||
id: REL8DyBnfWYiXCzxkMiv | ||
} |
21 changes: 21 additions & 0 deletions
21
...ions/ConsumerApi/src/http/Relationships/Reactivation/Reject Relationship Reactivation.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
meta { | ||
name: /Relationships/{id}/Reactivate/Reject | ||
type: http | ||
seq: 3 | ||
} | ||
|
||
put { | ||
url: {{baseUrl}}/Relationships/{{id}}/Reactivate/Reject | ||
body: json | ||
auth: inherit | ||
} | ||
|
||
body:json { | ||
{ | ||
"creationResponseContent": "" | ||
} | ||
} | ||
|
||
vars:pre-request { | ||
id: REL8DyBnfWYiXCzxkMiv | ||
} |
21 changes: 21 additions & 0 deletions
21
...ions/ConsumerApi/src/http/Relationships/Reactivation/Revoke Relationship Reactivation.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
meta { | ||
name: /Relationships/{id}/Reactivate/Revoke | ||
type: http | ||
seq: 4 | ||
} | ||
|
||
put { | ||
url: {{baseUrl}}/Relationships/{{id}}/Reactivate/Revoke | ||
body: json | ||
auth: inherit | ||
} | ||
|
||
body:json { | ||
{ | ||
"creationResponseContent": "" | ||
} | ||
} | ||
|
||
vars:pre-request { | ||
id: REL8DyBnfWYiXCzxkMiv | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
meta { | ||
name: /Tokens/{id} | ||
type: http | ||
seq: 4 | ||
} | ||
|
||
delete { | ||
url: {{baseUrl}}/Tokens/{{id}} | ||
body: none | ||
auth: inherit | ||
} | ||
|
||
vars:pre-request { | ||
id: TOKsjPynl0FHYJzHnkIo | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,8 @@ get { | |
auth: inherit | ||
} | ||
|
||
query { | ||
params:query { | ||
~ids: TOKsjPynl0FHYJzHnkIo | ||
~PageNumber: 1 | ||
~PageSize: 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
Applications/ConsumerApi/test/ConsumerApi.Tests.Integration/Contexts/FilesContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using Backbone.ConsumerApi.Sdk.Endpoints.Files.Types; | ||
|
||
namespace Backbone.ConsumerApi.Tests.Integration.Contexts; | ||
|
||
public class FilesContext | ||
{ | ||
public readonly Dictionary<string, FileMetadata> Files = []; | ||
} |
2 changes: 0 additions & 2 deletions
2
Applications/ConsumerApi/test/ConsumerApi.Tests.Integration/Contexts/RelationshipsContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
using Backbone.ConsumerApi.Sdk.Endpoints.Relationships.Types; | ||
using Backbone.ConsumerApi.Sdk.Endpoints.RelationshipTemplates.Types.Responses; | ||
|
||
namespace Backbone.ConsumerApi.Tests.Integration.Contexts; | ||
|
||
public class RelationshipsContext | ||
{ | ||
public readonly Dictionary<string, Relationship> Relationships = new(); | ||
public readonly Dictionary<string, CreateRelationshipTemplateResponse> CreateRelationshipTemplateResponses = new(); | ||
} |
11 changes: 11 additions & 0 deletions
11
...cations/ConsumerApi/test/ConsumerApi.Tests.Integration/Features/Files/{id}/DELETE.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@Integration | ||
Feature: DELETE /Files/{id} | ||
|
||
User deletes a File | ||
|
||
Scenario: Deleting a File actually removes it | ||
Given Identity i | ||
And File f created by i | ||
When i sends a DELETE request to the /Files/f.Id endpoint | ||
And i sends a GET request to the /Files/f.Id endpoint | ||
Then the response status code is 404 (Not Found) |
Oops, something went wrong.