mirror of
https://github.com/netbirdio/netbird.git
synced 2026-05-20 07:39:56 +00:00
Rotate Access token with refresh token (#280)
Add method for rotating access token with refresh tokens This will be useful for catching expired sessions and offboarding users Also added functions to handle secrets. They have to be revisited as some tests didn't run on CI as they waited some user input, like password
This commit is contained in:
27
client/internal/oauth/secret_test.go
Normal file
27
client/internal/oauth/secret_test.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package oauth
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/require"
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSecret(t *testing.T) {
|
||||
// this test is not ready to run as part of our ci/cd
|
||||
// todo fix testing
|
||||
if os.Getenv("CI") == "true" {
|
||||
t.Skip("skipping testing in github actions")
|
||||
}
|
||||
|
||||
key := "testing"
|
||||
value := "1234"
|
||||
err := SetSecret(key, value)
|
||||
require.NoError(t, err, "should set secret")
|
||||
|
||||
v, err := GetSecret(key)
|
||||
require.NoError(t, err, "should retrieve secret")
|
||||
require.Equal(t, value, v, "values should match")
|
||||
|
||||
err = DeleteSecret(key)
|
||||
require.NoError(t, err, "should delete secret")
|
||||
}
|
||||
Reference in New Issue
Block a user