-
Notifications
You must be signed in to change notification settings - Fork 6
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
[#167569704] Add GetLimitedProfile function #6
Conversation
GetLimitedProfile/handler.ts
Outdated
|
||
/** | ||
* Whether the sender service is allowed to send | ||
* notififications to the user identified by this profile |
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.
* notififications to the user identified by this profile | |
* messages to the user identified by this profile |
GetLimitedProfile/handler.ts
Outdated
} | ||
|
||
/** | ||
* Converts the Profile model to LimetedProfile type. |
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.
* Converts the Profile model to LimetedProfile type. | |
* Converts the Profile model to LimitedProfile type. |
GetLimitedProfile/handler.ts
Outdated
|
||
const middlewaresWrap = withRequestMiddlewares( | ||
AzureApiAuthMiddleware( | ||
new Set([UserGroup.ApiLimitedProfileRead, UserGroup.ApiFullProfileRead]) |
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.
since this API will be used only by 3rd party services, we can limit the groups to ApiLimitedProfileRead
(ApiFullProfileRead
is only used by the app backend)
new Set([UserGroup.ApiLimitedProfileRead, UserGroup.ApiFullProfileRead]) | |
new Set([UserGroup.ApiLimitedProfileRead]) |
} from "../handler"; | ||
|
||
describe("isSenderAllowed", () => { | ||
it("should return false is the service is not allowed to send notifications to the user", () => { |
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.
it("should return false is the service is not allowed to send notifications to the user", () => { | |
it("should return false if the service is not allowed to send notifications to the user", () => { |
expect(isAllowed).toBe(false); | ||
}); | ||
|
||
it("should return true is the service is allowed to send notifications to the user", () => { |
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.
it("should return true is the service is allowed to send notifications to the user", () => { | |
it("should return true if the service is allowed to send notifications to the user", () => { |
yes go ahead, thanks |
df80a3c
to
ba354b0
Compare
Affected stories
Generated by 🚫 dangerJS |
Codecov Report
@@ Coverage Diff @@
## master #6 +/- ##
==========================================
+ Coverage 73.33% 76.68% +3.35%
==========================================
Files 2 3 +1
Lines 150 193 +43
Branches 14 19 +5
==========================================
+ Hits 110 148 +38
- Misses 40 45 +5 |
Draft because we need to decide how to handle the routes of the two http triggered functions.
For GetLimitedProfile i have set
v1/profiles/{fiscalCode}
. If it is ok for you i can change the CreateMessage route from{*segments}
tov1/messages/{fiscalCode}
.