Skip to content

Commit c8e3cb9

Browse files
fix openziti/ziti#3352 adds api session ressumption to edge_apis
adds method type, ApiSession interface JSON wrapper - adds string alias type AuthMethod - adds AuthMethodEmpty as a sentinal type - adds ApiSessionJsonWrapper to allow direct (un)marshalling of ApiSession via interface - adds the ability to provide custom http client and transports - adds an inline OAuth2/OIDC rp token authentication - update redirect URI handling, ensure default uses ported value
1 parent 2024c7e commit c8e3cb9

19 files changed

+2251
-1505
lines changed

edge-apis/api_session.go

Lines changed: 429 additions & 0 deletions
Large diffs are not rendered by default.

edge-apis/api_session_test.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package edge_apis
2+
3+
import (
4+
"encoding/json"
5+
"testing"
6+
7+
"github.com/stretchr/testify/require"
8+
)
9+
10+
func Test_ApiSessionMarshalling(t *testing.T) {
11+
12+
t.Run("test marshalling", func(t *testing.T) {
13+
req := require.New(t)
14+
type testStruct struct {
15+
ApiSession ApiSessionJsonWrapper `json:"apiSession"`
16+
}
17+
18+
test := &testStruct{
19+
ApiSession: ApiSessionJsonWrapper{
20+
ApiSession: NewApiSessionOidc("access", "refresh"),
21+
},
22+
}
23+
24+
testJson, err := json.Marshal(test)
25+
req.NoError(err)
26+
27+
testUnmarhsal := &testStruct{}
28+
29+
err = json.Unmarshal(testJson, testUnmarhsal)
30+
req.NoError(err)
31+
req.Equal(test.ApiSession.ApiSession.GetToken(), testUnmarhsal.ApiSession.ApiSession.GetToken())
32+
})
33+
}

0 commit comments

Comments
 (0)