Skip to content

feat: support remote specs with authentication#230

Merged
mnahkies merged 5 commits intomainfrom
mn/229/authentication-remote-specifications
Aug 3, 2024
Merged

feat: support remote specs with authentication#230
mnahkies merged 5 commits intomainfrom
mn/229/authentication-remote-specifications

Conversation

@mnahkies
Copy link
Owner

@mnahkies mnahkies commented Aug 3, 2024

  • new cli param --remote-spec-request-headers /
    OPENAPI_REMOTE_SPEC_REQUEST_HEADERS

  • accepts a JSON object like {[uri: string]: {name: string, value: string} | {name: string, value: string}[]}

    • I don't love using JSON as a format for this, however at least
      it's standardized and escaping values etc is well understood. By
      using JSON I'm confident that there won't be any edge cases with
      spaces or other separaters that would need handling with a format
      like <uri>:<name>:<value>
  • main use-case is for generating from remote specs that are behind some
    format of request header based authentication (eg: private github
    repos, GCP IAP proxy, etc)

    • Previously I was having to curl these to the local filesystem
      first, which is inconvenient

closes #229

- new cli param `--remote-spec-request-headers` /
  `OPENAPI_REMOTE_SPEC_REQUEST_HEADERS`

- accepts a JSON object like `{[uri: string]: {name: string, value: string}[]}`
  - I don't _love_ using JSON as a format for this, however at least
    it's standardized and escaping values etc is well understood. By
    using JSON I'm confident that there won't be any edge cases with
    spaces or other separaters that would need handling with a format
    like `<uri>:<name>:<value>`

- main use-case is for generating from remote specs that are behind some
  format of request header based authentication (eg: private github
  repos, GCP IAP proxy, etc)
  - Previously I was having to `curl` these to the local filesystem
    first, which is inconvenient
@mnahkies mnahkies merged commit 5beee35 into main Aug 3, 2024
@mnahkies mnahkies deleted the mn/229/authentication-remote-specifications branch August 3, 2024 09:25
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.

cli: support passing authentication headers when generating from urls

1 participant