Skip to content

Commit

Permalink
Add auth
Browse files Browse the repository at this point in the history
  • Loading branch information
rubyistdotjs committed Jun 6, 2023
1 parent 638433c commit a904edf
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 2 deletions.
13 changes: 12 additions & 1 deletion api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,18 @@ Class | Method | HTTP request | Description

## Documentation For Authorization

Endpoints do not require authorization.

Authentication schemes defined for the API:
### bearerAuth

- **Type**: HTTP Bearer token authentication

Example

```golang
auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARER_TOKEN_STRING")
r, err := client.Service.Operation(auth, args)
```


## Documentation for Utility Methods
Expand Down
7 changes: 7 additions & 0 deletions api/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ paths:
schema:
$ref: '#/components/schemas/inline_response_default'
description: Unexpected error
security:
- bearerAuth: []
summary: Find events.
tags:
- Events
Expand Down Expand Up @@ -1607,3 +1609,8 @@ components:
example: https://dcsa.org/dcsa/tnt/v2/events
type: object
example: null
securitySchemes:
bearerAuth:
bearerFormat: JWT
scheme: bearer
type: http
5 changes: 5 additions & 0 deletions api/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions api/configuration.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/docs/EventsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Name | Type | Description | Notes

### Authorization

No authorization required
[bearerAuth](../README.md#bearerAuth)

### HTTP request headers

Expand Down
7 changes: 7 additions & 0 deletions api_files/msc-dcsa-track-and-trace-2.2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ paths:
summary: Find events.
description: Find events by Carrier BookingReference, Transport DocumentReference (Bill of lading) or Equipment Reference.The endpoint **requires** only 1 of the 3 query parameters to be used.
operationId: GetEvents
security:
- bearerAuth: []
parameters:
- name: carrierBookingReference
in: query
Expand Down Expand Up @@ -1212,3 +1214,8 @@ components:
required: false
schema:
$ref: '#/components/schemas/equipmentReference'
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT

0 comments on commit a904edf

Please sign in to comment.