Skip to content

Commit

Permalink
Merge pull request #86 from form3tech-oss/add-http-azure-private-call…
Browse files Browse the repository at this point in the history
…back-transport

feat: add `http_azure_private` subscription callback transport
  • Loading branch information
jerzy-dudek-form3 authored Jun 27, 2024
2 parents 92744eb + 3f72b72 commit a100553
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 4 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ A simple client library with:
- A fluent API with reduced repetition compared with vanilla swagger-go generated clients
- All the power and flexibility of Go!

## Contributing

Please include proof of running the full test suite over the Form3 API with the following variables set:
* `FORM3_CLIENT_ID`
* `FORM3_CLIENT_SECRET`
* `FORM3_ORGANISATION_ID`
* `FORM3_HOST`
* `FORM3_PRIVATE_KEY`
* `FORM3_PUBLIC_KEY_ID`

In case of external contributions, it is the responsibility of the reviewer to run those tests.

## Getting started

For interactive usage we recommend using [gore](https://github.com/motemen/gore).
Expand Down
4 changes: 1 addition & 3 deletions pkg/form3/auth_token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ import (
)

func TestTokenAuth(t *testing.T) {
if os.Getenv("FORM3_CLIENT_ID") == "" || os.Getenv("FORM3_CLIENT_SECRET") == "" {
t.Skip("WARN: FORM3_CLIENT_ID or FORM3_CLIENT_SECRET not set, skipping test")
}
skipWhenCredentialsMissing(t)

u, err := uuid.Parse(os.Getenv("FORM3_CLIENT_ID"))
require.NoError(t, err)
Expand Down
12 changes: 12 additions & 0 deletions pkg/form3/helpers_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package form3_test

import (
"os"
"testing"
)

func skipWhenCredentialsMissing(t *testing.T) {
if os.Getenv("FORM3_CLIENT_ID") == "" || os.Getenv("FORM3_CLIENT_SECRET") == "" {
t.Skip("WARN: FORM3_CLIENT_ID or FORM3_CLIENT_SECRET not set, skipping test")
}
}
6 changes: 6 additions & 0 deletions pkg/form3/payments_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
)

func TestQueryPayments(t *testing.T) {
skipWhenCredentialsMissing(t)

f3, err := form3.NewFromEnv()
require.NoError(t, err)

Expand All @@ -22,6 +24,8 @@ func TestQueryPayments(t *testing.T) {
}

func TestPaymentFromJsonFile(t *testing.T) {
skipWhenCredentialsMissing(t)

f3, err := form3.NewFromEnv()
require.NoError(t, err)

Expand All @@ -34,6 +38,8 @@ func TestPaymentFromJsonFile(t *testing.T) {
}

func TestPaymentToJson(t *testing.T) {
skipWhenCredentialsMissing(t)

f3, err := form3.NewFromEnv()
require.NoError(t, err)

Expand Down
4 changes: 4 additions & 0 deletions pkg/form3/subscriptions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ func TestCreateSubscriptionsNewCallbackUriParamsHttpAwsPrivate(t *testing.T) {
}

func testCreateAndUpdateSubscriptions(t *testing.T, attributes *models.SubscriptionAttributes) {
skipWhenCredentialsMissing(t)

f3, err := form3.NewFromEnv()
require.NoError(t, err)

Expand Down Expand Up @@ -103,6 +105,8 @@ func testCreateAndUpdateSubscriptions(t *testing.T, attributes *models.Subscript
}

func TestListSubscriptions(t *testing.T) {
skipWhenCredentialsMissing(t)

f3, err := form3.NewFromEnv()
require.NoError(t, err)

Expand Down
5 changes: 4 additions & 1 deletion pkg/generated/models/callback_transport.go

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

0 comments on commit a100553

Please sign in to comment.