Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- **Feature:** Add package `runtime`, which implements methods to be used when performing API requests
- **Feature:** Add method `WithCaptureHTTPResponse` to package `runtime`, which does the same as `config.WithCaptureHTTPResponse`. Method was moved to avoid confusion due to it not being a configuration option, and will be removed in a later release.
- **Deprecation:** Mark method `config.WithCaptureHTTPResponse` as deprecated, to avoid confusion due to it not being a configuration option. Use `runtime.WithCaptureHTTPResponse` instead.
- **Breaking Change:** Removed method `KeyFlow.Clone`, that were no longer being used.

## Release (2024-02-07)

Expand Down
1 change: 1 addition & 0 deletions core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## v0.9.0 (YYYY-MM-DD)

- **Deprecation:** Mark method `config.WithCaptureHTTPResponse` as deprecated, to avoid confusion due to it not being a configuration option. Use `runtime.WithCaptureHTTPResponse` instead.
- **Breaking Change:** Removed method `KeyFlow.Clone`, that were no longer being used.

## v0.8.0 (2024-02-16)

Expand Down
15 changes: 0 additions & 15 deletions core/clients/key_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,21 +150,6 @@ func (c *KeyFlow) SetToken(accessToken, refreshToken string) error {
return nil
}

// Clone creates a clone of the client
func (c *KeyFlow) Clone() interface{} {
sc := *c
nc := &sc
cl := *nc.client
cf := *nc.config
ke := *nc.key
to := *nc.token
nc.client = &cl
nc.config = &cf
nc.key = &ke
nc.token = &to
return c
}

// Roundtrip performs the request
func (c *KeyFlow) RoundTrip(req *http.Request) (*http.Response, error) {
if c.client == nil {
Expand Down
19 changes: 0 additions & 19 deletions core/clients/key_flow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"fmt"
"io"
"net/http"
"reflect"
"strings"
"testing"
"time"
Expand Down Expand Up @@ -189,24 +188,6 @@ func TestSetToken(t *testing.T) {
}
}

func TestKeyClone(t *testing.T) {
c := &KeyFlow{
client: &http.Client{},
config: &KeyFlowConfig{},
key: &ServiceAccountKeyResponse{},
token: &TokenResponseBody{},
}

clone, ok := c.Clone().(*KeyFlow)
if !ok {
t.Fatalf("Type assertion failed")
}

if !reflect.DeepEqual(c, clone) {
t.Errorf("Clone() = %v, want %v", clone, c)
}
}

func TestKeyFlowValidateToken(t *testing.T) {
// Generate a random private key
privateKey := make([]byte, 32)
Expand Down