Skip to content

Commit 6a57749

Browse files
authored
feat: update API configuration and security schemes (#1717)
1 parent 6f05ec0 commit 6a57749

20 files changed

Lines changed: 296 additions & 380 deletions

File tree

‎ee/gateway/openapi.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ paths:
77
get:
88
summary: Show stack version information
99
operationId: getVersions
10+
security:
11+
- NoAuthorization: []
12+
- Authorization: []
1013
responses:
1114
"200":
1215
description: OK

‎releases/base.yaml‎

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,19 @@ info:
2525
servers:
2626
- url: http://localhost
2727
description: local server
28-
- url: https://{stack}.sandbox.formance.cloud
29-
description: sandbox server
30-
31-
#security: {}
32-
# - Authorization: []
28+
- url: https://{organization}.{environment}.formance.cloud
29+
description: A per-organization and per-environment API
30+
variables:
31+
organization:
32+
description: The organization name. Defaults to a generic organization.
33+
default: orgID-stackID
34+
environment:
35+
description: The environment name. Defaults to the production environment.
36+
default: sandbox
37+
enum:
38+
- sandbox
39+
- eu-west-1
40+
- us-east-1
3341

3442
tags:
3543
- name: ledger.v1
@@ -52,6 +60,13 @@ components:
5260
tokenUrl: '/api/auth/oauth/token'
5361
refreshUrl: '/api/auth/oauth/token'
5462
scopes: {}
63+
NoAuthorization:
64+
type: oauth2
65+
flows:
66+
clientCredentials:
67+
tokenUrl: '/api/auth/oauth/token'
68+
refreshUrl: '/api/auth/oauth/token'
69+
scopes: {}
5570

5671
x-tagGroups:
5772
- name: Auth

‎releases/sdks/go/.speakeasy/gen.lock‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
lockVersion: 2.0.0
22
id: 8cc5b996-ee96-49ac-9b4e-0cc5e3bfbe2f
33
management:
4-
docChecksum: b7819acc5410d6ccf3e18e9f29abd68c
4+
docChecksum: 3e0d37eeb0f9d7736e21ce3e275b7eeb
55
docVersion: v0.0.0
66
speakeasyVersion: 1.351.0
77
generationVersion: 2.384.1

‎releases/sdks/go/README.md‎

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ import (
4242
func main() {
4343
s := v2.New(
4444
v2.WithSecurity(shared.Security{
45-
ClientID: "",
46-
ClientSecret: "",
45+
ClientID: v2.String(""),
4746
}),
4847
)
4948

@@ -295,8 +294,7 @@ import (
295294
func main() {
296295
s := v2.New(
297296
v2.WithSecurity(shared.Security{
298-
ClientID: "",
299-
ClientSecret: "",
297+
ClientID: v2.String(""),
300298
}),
301299
)
302300

@@ -348,8 +346,7 @@ func main() {
348346
RetryConnectionErrors: false,
349347
}),
350348
v2.WithSecurity(shared.Security{
351-
ClientID: "",
352-
ClientSecret: "",
349+
ClientID: v2.String(""),
353350
}),
354351
)
355352

@@ -395,8 +392,7 @@ import (
395392
func main() {
396393
s := v2.New(
397394
v2.WithSecurity(shared.Security{
398-
ClientID: "",
399-
ClientSecret: "",
395+
ClientID: v2.String(""),
400396
}),
401397
)
402398
request := operations.CreateTransactionsRequest{
@@ -448,7 +444,7 @@ You can override the default server globally using the `WithServerIndex` option
448444
| # | Server | Variables |
449445
| - | ------ | --------- |
450446
| 0 | `http://localhost` | None |
451-
| 1 | `https://{stack}.sandbox.formance.cloud` | None |
447+
| 1 | `https://{organization}.{environment}.formance.cloud` | `environment` (default is `sandbox`), `organization` (default is `orgID-stackID`) |
452448

453449
#### Example
454450

@@ -466,8 +462,7 @@ func main() {
466462
s := v2.New(
467463
v2.WithServerIndex(1),
468464
v2.WithSecurity(shared.Security{
469-
ClientID: "",
470-
ClientSecret: "",
465+
ClientID: v2.String(""),
471466
}),
472467
)
473468

@@ -483,6 +478,11 @@ func main() {
483478

484479
```
485480

481+
#### Variables
482+
483+
Some of the server options above contain variables. If you want to set the values of those variables, the following options are provided for doing so:
484+
* `WithEnvironment v2.ServerEnvironment`
485+
* `WithOrganization string`
486486

487487
### Override Server URL Per-Client
488488

@@ -501,8 +501,7 @@ func main() {
501501
s := v2.New(
502502
v2.WithServerURL("http://localhost"),
503503
v2.WithSecurity(shared.Security{
504-
ClientID: "",
505-
ClientSecret: "",
504+
ClientID: v2.String(""),
506505
}),
507506
)
508507

@@ -574,8 +573,7 @@ import (
574573
func main() {
575574
s := v2.New(
576575
v2.WithSecurity(shared.Security{
577-
ClientID: "",
578-
ClientSecret: "",
576+
ClientID: v2.String(""),
579577
}),
580578
)
581579

‎releases/sdks/go/USAGE.md‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ import (
1212
func main() {
1313
s := v2.New(
1414
v2.WithSecurity(shared.Security{
15-
ClientID: "",
16-
ClientSecret: "",
15+
ClientID: v2.String(""),
1716
}),
1817
)
1918

‎releases/sdks/go/docs/pkg/models/shared/security.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55

66
| Field | Type | Required | Description | Example |
77
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
8-
| `ClientID` | *string* | :heavy_check_mark: | N/A | |
9-
| `ClientSecret` | *string* | :heavy_check_mark: | N/A | |
10-
| `TokenURL` | *string* | :heavy_check_mark: | N/A | |
8+
| `ClientID` | **string* | :heavy_minus_sign: | N/A | |
9+
| `ClientSecret` | **string* | :heavy_minus_sign: | N/A | |
10+
| `TokenURL` | **string* | :heavy_minus_sign: | N/A | |

‎releases/sdks/go/docs/sdks/formance/README.md‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ import(
3939
func main() {
4040
s := v2.New(
4141
v2.WithSecurity(shared.Security{
42-
ClientID: "",
43-
ClientSecret: "",
42+
ClientID: v2.String(""),
4443
}),
4544
)
4645

‎releases/sdks/go/docs/sdks/formanceorchestrationv1/README.md‎

Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ import(
4141
func main() {
4242
s := v2.New(
4343
v2.WithSecurity(shared.Security{
44-
ClientID: "",
45-
ClientSecret: "",
44+
ClientID: v2.String(""),
4645
}),
4746
)
4847
request := operations.CancelEventRequest{
@@ -95,8 +94,7 @@ import(
9594
func main() {
9695
s := v2.New(
9796
v2.WithSecurity(shared.Security{
98-
ClientID: "",
99-
ClientSecret: "",
97+
ClientID: v2.String(""),
10098
}),
10199
)
102100

@@ -147,8 +145,7 @@ import(
147145
func main() {
148146
s := v2.New(
149147
v2.WithSecurity(shared.Security{
150-
ClientID: "",
151-
ClientSecret: "",
148+
ClientID: v2.String(""),
152149
}),
153150
)
154151

@@ -200,8 +197,7 @@ import(
200197
func main() {
201198
s := v2.New(
202199
v2.WithSecurity(shared.Security{
203-
ClientID: "",
204-
ClientSecret: "",
200+
ClientID: v2.String(""),
205201
}),
206202
)
207203
request := operations.DeleteTriggerRequest{
@@ -255,8 +251,7 @@ import(
255251
func main() {
256252
s := v2.New(
257253
v2.WithSecurity(shared.Security{
258-
ClientID: "",
259-
ClientSecret: "",
254+
ClientID: v2.String(""),
260255
}),
261256
)
262257
request := operations.DeleteWorkflowRequest{
@@ -310,8 +305,7 @@ import(
310305
func main() {
311306
s := v2.New(
312307
v2.WithSecurity(shared.Security{
313-
ClientID: "",
314-
ClientSecret: "",
308+
ClientID: v2.String(""),
315309
}),
316310
)
317311
request := operations.GetInstanceRequest{
@@ -365,8 +359,7 @@ import(
365359
func main() {
366360
s := v2.New(
367361
v2.WithSecurity(shared.Security{
368-
ClientID: "",
369-
ClientSecret: "",
362+
ClientID: v2.String(""),
370363
}),
371364
)
372365
request := operations.GetInstanceHistoryRequest{
@@ -420,8 +413,7 @@ import(
420413
func main() {
421414
s := v2.New(
422415
v2.WithSecurity(shared.Security{
423-
ClientID: "",
424-
ClientSecret: "",
416+
ClientID: v2.String(""),
425417
}),
426418
)
427419
request := operations.GetInstanceStageHistoryRequest{
@@ -476,8 +468,7 @@ import(
476468
func main() {
477469
s := v2.New(
478470
v2.WithSecurity(shared.Security{
479-
ClientID: "",
480-
ClientSecret: "",
471+
ClientID: v2.String(""),
481472
}),
482473
)
483474
request := operations.GetWorkflowRequest{
@@ -531,8 +522,7 @@ import(
531522
func main() {
532523
s := v2.New(
533524
v2.WithSecurity(shared.Security{
534-
ClientID: "",
535-
ClientSecret: "",
525+
ClientID: v2.String(""),
536526
}),
537527
)
538528
request := operations.ListInstancesRequest{
@@ -587,8 +577,7 @@ import(
587577
func main() {
588578
s := v2.New(
589579
v2.WithSecurity(shared.Security{
590-
ClientID: "",
591-
ClientSecret: "",
580+
ClientID: v2.String(""),
592581
}),
593582
)
594583
request := operations.ListTriggersRequest{}
@@ -640,8 +629,7 @@ import(
640629
func main() {
641630
s := v2.New(
642631
v2.WithSecurity(shared.Security{
643-
ClientID: "",
644-
ClientSecret: "",
632+
ClientID: v2.String(""),
645633
}),
646634
)
647635
request := operations.ListTriggersOccurrencesRequest{
@@ -694,8 +682,7 @@ import(
694682
func main() {
695683
s := v2.New(
696684
v2.WithSecurity(shared.Security{
697-
ClientID: "",
698-
ClientSecret: "",
685+
ClientID: v2.String(""),
699686
}),
700687
)
701688

@@ -745,8 +732,7 @@ import(
745732
func main() {
746733
s := v2.New(
747734
v2.WithSecurity(shared.Security{
748-
ClientID: "",
749-
ClientSecret: "",
735+
ClientID: v2.String(""),
750736
}),
751737
)
752738

@@ -797,8 +783,7 @@ import(
797783
func main() {
798784
s := v2.New(
799785
v2.WithSecurity(shared.Security{
800-
ClientID: "",
801-
ClientSecret: "",
786+
ClientID: v2.String(""),
802787
}),
803788
)
804789
request := operations.ReadTriggerRequest{
@@ -852,8 +837,7 @@ import(
852837
func main() {
853838
s := v2.New(
854839
v2.WithSecurity(shared.Security{
855-
ClientID: "",
856-
ClientSecret: "",
840+
ClientID: v2.String(""),
857841
}),
858842
)
859843
request := operations.RunWorkflowRequest{
@@ -907,8 +891,7 @@ import(
907891
func main() {
908892
s := v2.New(
909893
v2.WithSecurity(shared.Security{
910-
ClientID: "",
911-
ClientSecret: "",
894+
ClientID: v2.String(""),
912895
}),
913896
)
914897
request := operations.SendEventRequest{

0 commit comments

Comments
 (0)