Skip to content
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

[#170129433] Get all services #11

Merged
merged 8 commits into from
Feb 21, 2020
Merged

[#170129433] Get all services #11

merged 8 commits into from
Feb 21, 2020

Conversation

alexgpeppe
Copy link
Contributor

This PR aims to add a function to get the collection of all services.

@digitalcitizenship
Copy link

digitalcitizenship commented Feb 11, 2020

Affected stories

  • 🌟 #170129433: Come backend voglio poter recuperare la lista delle subscription / servizi per uno specifico utente gestore

Generated by 🚫 dangerJS

// Extract Azure Functions bindings
ContextMiddleware(),
// Allow only users in the ApiServiceWrite group
AzureApiAuthMiddleware(new Set([UserGroup.ApiServiceRead]))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need a new permission ApiServiceList.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ApiServiceList, ApiServiceKeyRead. ApiServiceKeyWrite. Can you change this one here with ApiServiceList ?

@gunzip gunzip added the on-hold label Feb 11, 2020
// Extract Azure Functions bindings
ContextMiddleware(),
// Allow only users in the ApiServiceWrite group
AzureApiAuthMiddleware(new Set([UserGroup.ApiServiceRead]))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ApiServiceList, ApiServiceKeyRead. ApiServiceKeyWrite. Can you change this one here with ApiServiceList ?

Copy link
Contributor

@gunzip gunzip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs rebasing (package.json / yarn.lock conflicts)

@alexgpeppe alexgpeppe force-pushed the 170129433-get-all-services branch from 3487b42 to 67fe335 Compare February 20, 2020 16:12
@codecov-io
Copy link

codecov-io commented Feb 20, 2020

Codecov Report

Merging #11 into master will decrease coverage by 0.83%.
The diff coverage is 76.47%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #11      +/-   ##
==========================================
- Coverage   85.27%   84.44%   -0.84%     
==========================================
  Files           8        9       +1     
  Lines         163      180      +17     
  Branches       13       13              
==========================================
+ Hits          139      152      +13     
- Misses         23       27       +4     
  Partials        1        1
Impacted Files Coverage Δ
GetServices/handler.ts 76.47% <76.47%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6c7661c...137a6ce. Read the comment docs.

GetServices/__tests__/handler.test.ts Outdated Show resolved Hide resolved

const middlewaresWrap = withRequestMiddlewares(
// Extract Azure Functions bindings
ContextMiddleware(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since some services (the calling service tied to the current api-key)
may have restrictions on origin IP addresses, you must apply all middlewares here:

https://github.com/pagopa/io-functions-admin/blob/master/GetService/handler.ts#L100

in order to call checkSourceIpForHandler

@gunzip gunzip merged commit 02b3fd2 into master Feb 21, 2020
@gunzip gunzip deleted the 170129433-get-all-services branch February 21, 2020 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants