Skip to content

Commit 64959be

Browse files
authored
fix: apiKey auth example (#32)
1 parent 9999757 commit 64959be

File tree

286 files changed

+11587
-5625
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

286 files changed

+11587
-5625
lines changed

.openapi-generator/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.0.0
1+
7.9.0

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM openapitools/openapi-generator-cli:v7.0.0
1+
FROM openapitools/openapi-generator-cli:v7.9.0
22

33
RUN apt-get update \
44
&& apt-get install -y --no-install-recommends jq golang \

README.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,30 @@ The API to the Cloudsmith Service
55
## Overview
66
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client.
77

8-
- API version: 1.533.1
9-
- Package version: 0.0.40
8+
- API version: 1.536.1
9+
- Package version: 0.0.41
10+
- Generator version: 7.9.0
1011
- Build package: org.openapitools.codegen.languages.GoClientCodegen
1112
For more information, please visit [https://help.cloudsmith.io](https://help.cloudsmith.io)
1213

1314
## Installation
1415

1516
Install the following dependencies:
1617

17-
```shell
18+
```sh
1819
go get github.com/stretchr/testify/assert
1920
go get golang.org/x/net/context
2021
```
2122

2223
Put the package under your project folder and add the following in import:
2324

24-
```golang
25+
```go
2526
import cloudsmith "github.com/cloudsmith-io/cloudsmith-api-go"
2627
```
2728

2829
To use a proxy, set the environment variable `HTTP_PROXY`:
2930

30-
```golang
31+
```go
3132
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
3233
```
3334

@@ -37,17 +38,17 @@ Default configuration comes with `Servers` field that contains server objects as
3738

3839
### Select Server Configuration
3940

40-
For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`.
41+
For using other server than the one defined on index 0 set context value `cloudsmith.ContextServerIndex` of type `int`.
4142

42-
```golang
43+
```go
4344
ctx := context.WithValue(context.Background(), cloudsmith.ContextServerIndex, 1)
4445
```
4546

4647
### Templated Server URL
4748

48-
Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`.
49+
Templated server URL is formatted using default variables from configuration or from context value `cloudsmith.ContextServerVariables` of type `map[string]string`.
4950

50-
```golang
51+
```go
5152
ctx := context.WithValue(context.Background(), cloudsmith.ContextServerVariables, map[string]string{
5253
"basePath": "v2",
5354
})
@@ -59,9 +60,9 @@ Note, enum values are always validated and all unused variables are silently ign
5960

6061
Each operation can use different server URL defined using `OperationServers` map in the `Configuration`.
6162
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
62-
Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps.
63+
Similar rules for overriding default operation server index and variables applies by using `cloudsmith.ContextOperationServerIndices` and `cloudsmith.ContextOperationServerVariables` context maps.
6364

64-
```golang
65+
```go
6566
ctx := context.WithValue(context.Background(), cloudsmith.ContextOperationServerIndices, map[string]int{
6667
"{classname}Service.{nickname}": 2,
6768
})
@@ -618,16 +619,16 @@ Authentication schemes defined for the API:
618619
- **API key parameter name**: X-Api-Key
619620
- **Location**: HTTP header
620621

621-
Note, each API key must be added to a map of `map[string]APIKey` where the key is: X-Api-Key and passed in as the auth context for each request.
622+
Note, each API key must be added to a map of `map[string]APIKey` where the key is: apikey and passed in as the auth context for each request.
622623

623624
Example
624625

625-
```golang
626+
```go
626627
auth := context.WithValue(
627628
context.Background(),
628-
sw.ContextAPIKeys,
629-
map[string]sw.APIKey{
630-
"X-Api-Key": {Key: "API_KEY_STRING"},
629+
cloudsmith.ContextAPIKeys,
630+
map[string]cloudsmith.APIKey{
631+
"apikey": {Key: "API_KEY_STRING"},
631632
},
632633
)
633634
r, err := client.Service.Operation(auth, args)
@@ -639,10 +640,10 @@ r, err := client.Service.Operation(auth, args)
639640

640641
Example
641642

642-
```golang
643-
auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
644-
UserName: "username",
645-
Password: "password",
643+
```go
644+
auth := context.WithValue(context.Background(), cloudsmith.ContextBasicAuth, cloudsmith.BasicAuth{
645+
UserName: "username",
646+
Password: "password",
646647
})
647648
r, err := client.Service.Operation(auth, args)
648649
```

api/openapi.yaml

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ info:
1010
url: https://opensource.org/licenses/MIT
1111
termsOfService: https://help.cloudsmith.io
1212
title: Cloudsmith API (v1)
13-
version: 1.533.1
13+
version: 1.536.1
1414
servers:
1515
- url: https://api.cloudsmith.io/v1
1616
security:
@@ -12952,6 +12952,8 @@ paths:
1295212952
components:
1295312953
schemas:
1295412954
ErrorDetail:
12955+
example:
12956+
detail: detail
1295512957
properties:
1295612958
detail:
1295712959
description: An extended message for the response.
@@ -42688,7 +42690,7 @@ components:
4268842690
StatusBasic:
4268942691
example:
4269042692
detail: Cloudsmith API is operational.
42691-
version: 1.533.1
42693+
version: 1.536.1
4269242694
properties:
4269342695
detail:
4269442696
default: Cloudsmith API is operational.
@@ -42698,7 +42700,7 @@ components:
4269842700
title: Detail
4269942701
type: string
4270042702
version:
42701-
default: 1.533.1
42703+
default: 1.536.1
4270242704
description: The current version for the Cloudsmith service.
4270342705
minLength: 1
4270442706
readOnly: true
@@ -42931,9 +42933,9 @@ components:
4293142933
patch: 5
4293242934
major: 6
4293342935
minor: 1
42934-
version: version
42935-
operator: operator
42936-
raw_version: raw_version
42936+
version: ""
42937+
operator: ""
42938+
raw_version: ""
4293742939
properties:
4293842940
major:
4293942941
title: Major
@@ -42974,16 +42976,16 @@ components:
4297442976
patch: 5
4297542977
major: 6
4297642978
minor: 1
42977-
version: version
42978-
operator: operator
42979-
raw_version: raw_version
42979+
version: ""
42980+
operator: ""
42981+
raw_version: ""
4298042982
fixed_version:
4298142983
patch: 5
4298242984
major: 6
4298342985
minor: 1
42984-
version: version
42985-
operator: operator
42986-
raw_version: raw_version
42986+
version: ""
42987+
operator: ""
42988+
raw_version: ""
4298742989
references:
4298842990
- references
4298942991
- references
@@ -43057,16 +43059,16 @@ components:
4305743059
patch: 5
4305843060
major: 6
4305943061
minor: 1
43060-
version: version
43061-
operator: operator
43062-
raw_version: raw_version
43062+
version: ""
43063+
operator: ""
43064+
raw_version: ""
4306343065
fixed_version:
4306443066
patch: 5
4306543067
major: 6
4306643068
minor: 1
43067-
version: version
43068-
operator: operator
43069-
raw_version: raw_version
43069+
version: ""
43070+
operator: ""
43071+
raw_version: ""
4307043072
references:
4307143073
- references
4307243074
- references
@@ -43080,16 +43082,16 @@ components:
4308043082
patch: 5
4308143083
major: 6
4308243084
minor: 1
43083-
version: version
43084-
operator: operator
43085-
raw_version: raw_version
43085+
version: ""
43086+
operator: ""
43087+
raw_version: ""
4308643088
fixed_version:
4308743089
patch: 5
4308843090
major: 6
4308943091
minor: 1
43090-
version: version
43091-
operator: operator
43092-
raw_version: raw_version
43092+
version: ""
43093+
operator: ""
43094+
raw_version: ""
4309343095
references:
4309443096
- references
4309543097
- references
@@ -43135,16 +43137,16 @@ components:
4313543137
patch: 5
4313643138
major: 6
4313743139
minor: 1
43138-
version: version
43139-
operator: operator
43140-
raw_version: raw_version
43140+
version: ""
43141+
operator: ""
43142+
raw_version: ""
4314143143
fixed_version:
4314243144
patch: 5
4314343145
major: 6
4314443146
minor: 1
43145-
version: version
43146-
operator: operator
43147-
raw_version: raw_version
43147+
version: ""
43148+
operator: ""
43149+
raw_version: ""
4314843150
references:
4314943151
- references
4315043152
- references
@@ -43158,16 +43160,16 @@ components:
4315843160
patch: 5
4315943161
major: 6
4316043162
minor: 1
43161-
version: version
43162-
operator: operator
43163-
raw_version: raw_version
43163+
version: ""
43164+
operator: ""
43165+
raw_version: ""
4316443166
fixed_version:
4316543167
patch: 5
4316643168
major: 6
4316743169
minor: 1
43168-
version: version
43169-
operator: operator
43170-
raw_version: raw_version
43170+
version: ""
43171+
operator: ""
43172+
raw_version: ""
4317143173
references:
4317243174
- references
4317343175
- references

api_audit_log.go

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)