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

feat: only return approved third parties #310

Merged
merged 7 commits into from
Oct 20, 2021

Conversation

nicosantangelo
Copy link
Contributor

It also removed __typename from requests as we're not using it and it's cluttering our server responses (from thegraph)

@coveralls
Copy link

Pull Request Test Coverage Report for Build 1343434039

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 55.728%

Totals Coverage Status
Change from base Build 1343320142: 0.0%
Covered Lines: 1354
Relevant Lines: 2237

💛 - Coveralls

Comment on lines 57 to 58
maxItems
totalItems
Copy link
Contributor

Choose a reason for hiding this comment

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

Unless we're creating another endpoint to get the max items and the total items, I would leave these properties here so we can use them in the UI to tell the user to buy more slots.

import { ThirdParty } from './ThirdParty.types'

export function toThirdParty(fragment: ThirdPartyFragment): ThirdParty {
const { name, description } = fragment.metadata.thirdParty
Copy link
Contributor

Choose a reason for hiding this comment

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

I wouldn't use the object deconstruction here as thirdParty can be null.

thirdParty: {
name: string
description: string
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The property thirdParty can be null

}
})

it('should take a third party fragment and parse it to conform to the ThirdParty type', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

We can remove the async here, as we're not using the await keyword:

Suggested change
it('should take a third party fragment and parse it to conform to the ThirdParty type', async () => {
it('should take a third party fragment and parse it to conform to the ThirdParty type', () => {

@@ -74,7 +74,7 @@ async function decodeAuthChain(req: Request): Promise<string> {
errorMessage = 'Missing ETH address in auth chain'
} else {
try {
const endpoint = (req.method + ':' + req.url).toLowerCase()
const endpoint = (req.method + ':' + req.path).toLowerCase()
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have any kind of test that verifies this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't actually but I felt like testing the entire authentication middleware was a bit overkill for this PR

@nicosantangelo
Copy link
Contributor Author

Updated!

@nicosantangelo nicosantangelo merged commit 2089bf2 into master Oct 20, 2021
@nicosantangelo nicosantangelo deleted the feat/only-approved-third-parties branch October 20, 2021 19:30
LautaroPetaccio added a commit that referenced this pull request Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants