-
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: Password-protected RelationshipTemplates (#900)
* feat: support password protected relationship templates, wip * test: remove redundant scenarios * test: move step definitions to correct places and only use SINGLE_THING_OR_DEFAULT where it's fitting * test: rename SINGLE_THING_OR_DEFAULT to OPTIONAL_SINGLE_THING to better reflect its purpose * test: revert change to ThenTheResponseStatusCodeIs step definition * test: use GetBytes extension method to convert string to bytes * feat: when establishing a relationship, make sure the template is allocated by the active identity * chore: fix a nullability issue * refactor: expose RelationshipTemplate.CanBeCollectedWithPassword as simple method * test: use Convert.FromBase64String again * refactor: renaming and simplifcations * fix: change implementation of CanBeCollectedWithPassword2 to not compare arrays with equals operator * test: fix assertion * chore: rename scenario * test: remove redundant test case * test: state explicitly which relations templates are expected * test: tidy up * feat: update relationship template validators * chore: update method name * chore: rename method * chore: clean up message * chore: remove redundant method * feat: update sdk to allow for password protected templates * fix: add endpoint expected by transport tests * fix: add temporary endpoint to satisfy transport tests * feat: address pr change requests * fix: address issues causing tests to fail * chore: fix formatting * feat: catch and process json parsing exception * fix: revert manually edited snapshots * feat: add migration limiting the password length * test: limit the scope of resharper warning disabling * test: improve property names * refactor: rename RelationshipTemplateQuery to RelationshipTemplateQueryItem in SDK * refactor: don't set error message and code when using NumberOfBytes extension method * fix: allow camelCase in GetAll query string � Conflicts: � Modules/Relationships/src/Relationships.ConsumerApi/Controllers/RelationshipTemplatesController.cs * refactor: add curly braces for better readability * refactor: use generic application error in case the input cannot be parsed * fix: fix merge error * chore: delete redundant methods added by merge * chore: fix formatting * feat: revert to state before adding the password field * feat: add password with required length in a single migration * chore: remove comment * refactor: add migration "the correct way" * refactor: use new MAX_PASSWORD_LENGTH constant in ListRelationshipTemplatesQuery Validator * feat: validate password max length in GetRelationshipTemplateQuery * refactor: remove database configuration from db context * chore: fix formatting --------- Co-authored-by: Timo Notheisen <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
26be069
commit 8c93751
Showing
37 changed files
with
1,035 additions
and
91 deletions.
There are no files selected for viewing
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
47 changes: 47 additions & 0 deletions
47
...ConsumerApi/test/ConsumerApi.Tests.Integration/Features/RelationshipTemplates/GET.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,47 @@ | ||
@Integration | ||
Feature: GET /RelationshipTemplates | ||
|
||
User requests Relationship Templates | ||
|
||
Scenario Outline: Requesting a list of Relationship Templates in a variety of scenarios | ||
Given Identities i1, i2, i3 and i4 | ||
And the following Relationship Templates | ||
| templateName | templateOwner | forIdentity | password | | ||
| rt1 | i1 | - | - | | ||
| rt2 | i2 | - | - | | ||
| rt3 | i1 | - | - | | ||
| rt4 | i2 | - | - | | ||
| rt5 | i1 | - | password | | ||
| rt6 | i1 | - | password | | ||
| rt7 | i2 | - | password | | ||
| rt8 | i2 | - | password | | ||
| rt9 | i1 | i1 | - | | ||
| rt10 | i2 | i3 | - | | ||
| rt11 | i2 | i2 | - | | ||
| rt12 | i2 | i3 | - | | ||
| rt13 | i2 | i3 | password | | ||
| rt14 | i2 | i3 | password | | ||
When <activeIdentity> sends a GET request to the /RelationshipTemplate endpoint with the following payloads | ||
| templateName | passwordOnGet | | ||
| rt1 | - | | ||
| rt2 | - | | ||
| rt3 | password | | ||
| rt4 | password | | ||
| rt5 | password | | ||
| rt6 | - | | ||
| rt7 | password | | ||
| rt8 | - | | ||
| rt9 | - | | ||
| rt10 | - | | ||
| rt11 | - | | ||
| rt12 | - | | ||
| rt13 | password | | ||
| rt14 | wordpass | | ||
Then the response contains Relationship Template(s) <retreivedTemplates> | ||
|
||
Examples: | ||
| activeIdentity | retreivedTemplates | | ||
| i1 | rt1, rt2, rt3, rt4, rt5, rt6, rt7, rt9 | | ||
| i2 | rt1, rt2, rt3, rt4, rt5, rt7, rt8, rt10, rt11, rt12, rt13, rt14 | | ||
| i3 | rt1, rt2, rt3, rt4, rt5, rt7, rt10, rt12, rt13 | | ||
| i4 | rt1, rt2, rt3, rt4, rt5, rt7 | |
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
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
Oops, something went wrong.