-
Notifications
You must be signed in to change notification settings - Fork 0
[IOPAE-2127] activation functions implementation #1342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[IOPAE-2127] activation functions implementation #1342
Conversation
🦋 Changeset detectedLatest commit: 51287eb The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
38b4fc1
to
563ca25
Compare
Coverage Report for App Backend (./apps/app-backend)
File CoverageNo changed files found. |
Coverage Report for Backoffice Frontend (./apps/backoffice)
File CoverageNo changed files found. |
Coverage Report for Backoffice Backend (./apps/backoffice)
File CoverageNo changed files found. |
Coverage Report for Webapp (./apps/io-services-cms-webapp)
File Coverage
|
Coverage Report for External Clients (./packages/external-clients)
File CoverageNo changed files found. |
Coverage Report for Models (./packages/io-services-cms-models)
File CoverageNo changed files found. |
|
const SPECIAL_CATEGORY: ServiceLifecycle.definitions.Service["data"]["metadata"]["category"] = | ||
"SPECIAL"; | ||
|
||
// Authorization check: only services of SPECIAL_CATEGORY can proceed | ||
export const authorizedForSpecialServicesTask = ( | ||
category: ServiceLifecycle.definitions.Service["data"]["metadata"]["category"], | ||
): TE.TaskEither< | ||
IResponseErrorForbiddenNotAuthorized, | ||
ServiceLifecycle.definitions.Service["data"]["metadata"]["category"] | ||
> => | ||
pipe( | ||
O.fromNullable(category), | ||
O.filter((cat) => cat === SPECIAL_CATEGORY), | ||
TE.fromOption(() => ResponseErrorForbiddenNotAuthorized), | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion(non-blocking): we can refactor it into a more understandable form
const SPECIAL_CATEGORY: ServiceLifecycle.definitions.Service["data"]["metadata"]["category"] = | |
"SPECIAL"; | |
// Authorization check: only services of SPECIAL_CATEGORY can proceed | |
export const authorizedForSpecialServicesTask = ( | |
category: ServiceLifecycle.definitions.Service["data"]["metadata"]["category"], | |
): TE.TaskEither< | |
IResponseErrorForbiddenNotAuthorized, | |
ServiceLifecycle.definitions.Service["data"]["metadata"]["category"] | |
> => | |
pipe( | |
O.fromNullable(category), | |
O.filter((cat) => cat === SPECIAL_CATEGORY), | |
TE.fromOption(() => ResponseErrorForbiddenNotAuthorized), | |
); | |
// Authorization check: only services of SPECIAL_CATEGORY can proceed | |
export const authorizedForSpecialServicesTask = ( | |
category: ServiceLifecycle.definitions.Service["data"]["metadata"]["category"], | |
): TE.TaskEither<IResponseErrorForbiddenNotAuthorized, "SPECIAL"> => | |
pipe( | |
O.fromNullable(category), | |
O.filter((cat) => cat === "SPECIAL"), | |
TE.fromOption(() => ResponseErrorForbiddenNotAuthorized), | |
); |
List of Changes
openapi spec for activations api
fix open api to integrate headers from apim and and fix the activatio…
add json for upsert and get activation api
rename variables to distinguish between two storage account
add implementation for upsert and get activation api
add events for tracking
add utils for managing special servicesrename variable to distinguish between storage accounts
add unit test for the new api
fix unit test after refactoring
Motivation and Context
The necessity to move the Upsert and Get activation API from common to IO Enti&Servizi domain
How Has This Been Tested?
Screenshots (if appropriate):
Checklist: