-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(authentication): Add cli args for specifying session length and …
…renewal (#13924) Co-authored-by: Jade McGough <jade@influxdata.com> * Add session renew option to launcher and use in middlewhere * pass session options to services * Update SessionAutoRenew to SessionRenewDisabled * Add test for service constructor defaults * Update changelog
- Loading branch information
Showing
9 changed files
with
95 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package kv_test | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
"time" | ||
|
||
"github.com/influxdata/influxdb" | ||
"github.com/influxdata/influxdb/kv" | ||
) | ||
|
||
type mockStore struct { | ||
} | ||
|
||
func (s mockStore) View(context.Context, func(kv.Tx) error) error { | ||
return nil | ||
} | ||
|
||
func (s mockStore) Update(context.Context, func(kv.Tx) error) error { | ||
return nil | ||
} | ||
|
||
func TestNewService(t *testing.T) { | ||
s := kv.NewService(mockStore{}) | ||
|
||
if s.Config.SessionLength != influxdb.DefaultSessionLength { | ||
t.Errorf("Service session length should use default length when not set") | ||
} | ||
|
||
config := kv.ServiceConfig{ | ||
SessionLength: time.Duration(time.Hour * 4), | ||
} | ||
|
||
s = kv.NewService(mockStore{}, config) | ||
|
||
if s.Config != config { | ||
t.Errorf("Service config not set by constructor") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters