mirror of https://github.com/dexidp/dex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
507 B
18 lines
507 B
package refreshtest |
|
|
|
import ( |
|
"fmt" |
|
|
|
"github.com/coreos/dex/refresh" |
|
) |
|
|
|
// NewTestRefreshTokenRepo returns a test repo whose tokens monotonically increase. |
|
// The tokens are in the form { refresh-1, refresh-2 ... refresh-n}. |
|
func NewTestRefreshTokenRepo() (refresh.RefreshTokenRepo, error) { |
|
var tokenIdx int |
|
tokenGenerator := func() ([]byte, error) { |
|
tokenIdx++ |
|
return []byte(fmt.Sprintf("refresh-%d", tokenIdx)), nil |
|
} |
|
return refresh.NewRefreshTokenRepoWithTokenGenerator(tokenGenerator), nil |
|
}
|
|
|