Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

feat: update to the latest pinning service api spec #3

Merged
merged 5 commits into from
Nov 30, 2020

Conversation

aschmahmann
Copy link
Contributor

@aschmahmann aschmahmann commented Sep 21, 2020

👉 This needs #4 to be merged first

Updates the spec to v1.0.0.

Codegen issues/hacking:

  • Had to manually change the 4XX and 5XX code generation because it couldn't figure it out
  • Wrapped GetRequestid as GetRequestId as it seemed more Go idiomatic, but could remove it

@petar @lidel

Note: Do not merge until we have confirmation this works against https://github.com/ipfs-shipyard/rb-pinning-service-api

  • Get { "error" : "unauthorized" } when trying to run an ls using my credentials
    • This seems to indicate broken auth
    • Also, this doesn't use the error types

Could be bugs on my end but want to confirm @andrew

Resolved issues with the server.

Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

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

LGTM, but missing docs on generation + small concerns around ergonomics:

  • main ./README.md is missing steps on how to re-generate client
  • nit: ./openapi/README.md starts with long Markdown from description fiels in spec YAML, which buries the lead: the client overview docs start after 2/3 of the page - is there a generator flag to not include it?
  • nit: Error with only ErrorError looks weird, ideally we would flatten it and just have Error, if generator provides such feature. If not, we will have custom error responses in go-ipfs' /api/v0/pin/remote anyway, so I think its fine.

Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

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

@aschmahmann please try re-generating with v0.1.1, it should resolve the problem with ErrorError.

@aschmahmann aschmahmann force-pushed the feat/update-spec branch 2 times, most recently from 7ef30cd to 9572553 Compare October 15, 2020 19:35
Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

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

@aschmahmann / @petar this needs a fix for panics when remote endpoint is down (either network or DNS):

DNS lookup failure:

$ ipfs pin remote service add test_invalid_url_dns_svc https://invalid-service.example.com fake_api_key
$ ipfs pin remote ls --service=test_invalid_url_dns_svc
panic: unexpected error type: Get "https://invalid-service.example.com/pins?limit=10": dial tcp: lookup invalid-service.example.com on 127.0.0.1:53: no such host

goroutine 66 [running]:
github.com/ipfs/go-pinning-service-http-client.httperr(0x0, 0x209ee40, 0xc0007fc570, 0x0, 0x0)
	pkg/mod/github.com/ipfs/go-pinning-service-http-client@v0.0.0-20201030162340-38f3baeb8878/client.go:373 +0x745
github.com/ipfs/go-pinning-service-http-client.(*Client).lsInternal(0xc0007ce018, 0x20d1880, 0xc0006db400, 0xc00065e180, 0x0, 0x0, 0x0, 0xc0000775d0, 0xb2ef1c, 0xc0000a8000)
	pkg/mod/github.com/ipfs/go-pinning-service-http-client@v0.0.0-20201030162340-38f3baeb8878/client.go:232 +0x338
github.com/ipfs/go-pinning-service-http-client.(*Client).Ls.func1(0xc00065e120, 0xc00065e0c0, 0xc0007ce018, 0x20d1880, 0xc0006db400, 0xc00065e180)
	pkg/mod/github.com/ipfs/go-pinning-service-http-client@v0.0.0-20201030162340-38f3baeb8878/client.go:160 +0x306
created by github.com/ipfs/go-pinning-service-http-client.(*Client).Ls
	pkg/mod/github.com/ipfs/go-pinning-service-http-client@v0.0.0-20201030162340-38f3baeb8878/client.go:155 +0x1af

Service down:

$ ipfs pin remote service add test_invalid_url_down_svc https://127.0.0.1:43534 fake_api_key
$ ipfs pin remote ls --service=test_invalid_url_down_svc
panic: unexpected error type: Get "https://127.0.0.1:43534/pins?limit=10": dial tcp 127.0.0.1:43534: connect: connection refused

goroutine 25 [running]:
github.com/ipfs/go-pinning-service-http-client.httperr(0x0, 0x209ee40, 0xc0000fe3c0, 0x0, 0x0)
	pkg/mod/github.com/ipfs/go-pinning-service-http-client@v0.0.0-20201030162340-38f3baeb8878/client.go:373 +0x745
github.com/ipfs/go-pinning-service-http-client.(*Client).lsInternal(0xc0000c8090, 0x20d1880, 0xc000890a80, 0xc0000e81e0, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0)
	pkg/mod/github.com/ipfs/go-pinning-service-http-client@v0.0.0-20201030162340-38f3baeb8878/client.go:232 +0x338
github.com/ipfs/go-pinning-service-http-client.(*Client).Ls.func1(0xc0000e8180, 0xc0000e8120, 0xc0000c8090, 0x20d1880, 0xc000890a80, 0xc0000e81e0)
	pkg/mod/github.com/ipfs/go-pinning-service-http-client@v0.0.0-20201030162340-38f3baeb8878/client.go:160 +0x306
created by github.com/ipfs/go-pinning-service-http-client.(*Client).Ls
	pkg/mod/github.com/ipfs/go-pinning-service-http-client@v0.0.0-20201030162340-38f3baeb8878/client.go:155 +0x1af

@lidel lidel changed the title feat: update to pinning service api spec v1.0.0 feat: update to the latest pinning service api spec Nov 17, 2020
client.go Show resolved Hide resolved
client.go Outdated Show resolved Hide resolved
@aschmahmann aschmahmann merged commit 1be53f5 into feat/init Nov 30, 2020
Jorropo pushed a commit to ipfs/go-libipfs-rapide that referenced this pull request Mar 23, 2023
…at/update-spec

feat: update to the latest pinning service api spec

This commit was moved from ipfs/go-pinning-service-http-client@1be53f5
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants