-
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.
[DOVU Alpha V2] Guardian Middleware API rewrite (#20)
* Hide tsc scan errror * deprecating currents into into tests for alpha version of v2 * update an API endpoints for guardian v2 re-write * update in tags with reference to query routes and state queries * Update roles.ts * Update index.ts * Add password confirmation for guardian auth register * Update tsc interfaces * Update acc register for DTO for guardian * Alpha V2: scan JSON (500) error response for unprocessible entities 422 * Updated openAPI spec for valid endpoints * Rewrite/re-arch of API usage against policies. * Format been able to return valid values based off of enum for validation (used in ensure query role) * Dynamic ability for particular roles to reference block data for particular stages of a workflow * Query handler for role based data view -- allow for filtering for any downstream credential subject value * standalone utility to enable the ingestion of a credential, subject and filterable values to enable filtering * Chore prettier
- Loading branch information
1 parent
7b81880
commit 43fb482
Showing
34 changed files
with
1,216 additions
and
285 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
__tests__/e2e/fullAgrecalcPolicy.test.ts → ...deprecated/e2e/fullAgrecalcPolicy.test.ts
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
6 changes: 3 additions & 3 deletions
6
__tests__/e2e/fullCoolFarmPolicy.test.ts → ...deprecated/e2e/fullCoolFarmPolicy.test.ts
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
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
9 changes: 6 additions & 3 deletions
9
.../api/policies/[policyId]/project/index.ts → ...ies/[policyId]/sites/[id]/claims/index.ts
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,16 +1,19 @@ | ||
import onlyPost from 'src/middleware/onlyPost' | ||
import prepare from 'src/utils/prepare' | ||
import useGuardianContext from 'src/context/useGuardianContext' | ||
import ecologicalProjectHandler from 'src/handler/policies/ecologicalProjectHandler' | ||
import createClaimHandler from 'src/handler/policies/claims/createClaimHandler' | ||
import withAuthentication from 'src/middleware/withAuthentication' | ||
import withHmac from 'src/middleware/withHmac' | ||
import ensureRole from 'src/middleware/ensureRole' | ||
import { Role } from 'src/config/guardianTags' | ||
|
||
/** | ||
* 6 Month Deprecation notice: December 2023 - May 2024 | ||
*/ | ||
export default prepare( | ||
onlyPost, | ||
withHmac, | ||
useGuardianContext, | ||
withAuthentication, | ||
ensureRole(Role.REGISTRANT) | ||
)(ecologicalProjectHandler) | ||
ensureRole(Role.SUPPLIER) | ||
)(createClaimHandler) |
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,13 @@ | ||
import onlyGet from 'src/middleware/onlyGet' | ||
import prepare from 'src/utils/prepare' | ||
import useGuardianContext from 'src/context/useGuardianContext' | ||
import queryEntityHandler from 'src/handler/state/queryEntityHandler' | ||
import withAuthentication from 'src/middleware/withAuthentication' | ||
import ensureQueryDataRole from 'src/middleware/ensureQueryDataRole' | ||
|
||
export default prepare( | ||
onlyGet, | ||
useGuardianContext, | ||
withAuthentication, | ||
ensureQueryDataRole | ||
)(queryEntityHandler) |
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
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.