Skip to content

Commit

Permalink
Prune custom duration type (#45)
Browse files Browse the repository at this point in the history
* Prune custom duration type

* update CHANGELOG.md
  • Loading branch information
joe94 authored Oct 1, 2019
1 parent c61f547 commit e370453
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 34 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [v0.6.0]
- Prune use of unnecessary custom time.Duration

## [v0.5.0]
- Fixed panic in jws parser
- Fixed ClaimsWithLeeway to be unmarshaled into correctly
Expand Down Expand Up @@ -60,7 +63,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Added constructor, enforcer, and listener alice decorators
- Basic code and structure established

[Unreleased]: https://github.com/xmidt-org/bascule/compare/v0.5.0...HEAD
[Unreleased]: https://github.com/xmidt-org/bascule/compare/v0.6.0...HEAD
[v0.6.0]: https://github.com/xmidt-org/bascule/compare/0.5.0...v0.6.0
[v0.5.0]: https://github.com/xmidt-org/bascule/compare/0.4.0...v0.5.0
[v0.4.0]: https://github.com/xmidt-org/bascule/compare/0.3.1...v0.4.0
[v0.3.1]: https://github.com/xmidt-org/bascule/compare/0.3.0...v0.3.1
Expand Down
4 changes: 2 additions & 2 deletions key/resolverFactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package key

import (
"fmt"
"time"

"github.com/xmidt-org/webpa-common/resource"
"github.com/xmidt-org/webpa-common/types"
)

const (
Expand Down Expand Up @@ -38,7 +38,7 @@ type ResolverFactory struct {

// UpdateInterval specifies how often keys should be refreshed.
// If negative or zero, keys are never refreshed and are cached forever.
UpdateInterval types.Duration `json:"updateInterval"`
UpdateInterval time.Duration `json:"updateInterval"`

// Parser is a custom key parser. If omitted, DefaultParser is used.
Parser Parser `json:"-"`
Expand Down
31 changes: 0 additions & 31 deletions key/resolverFactory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,37 +117,6 @@ func TestBadURITemplates(t *testing.T) {
}
}

// func TestResolverFactoryNewUpdater(t *testing.T) {
// assert := assert.New(t)

// updateKeysCalled := make(chan struct{})
// runner := func(mock.Arguments) {
// defer func() {
// recover() // ignore panics from multiple closes
// }()

// close(updateKeysCalled)
// }

// keyCache := &MockCache{}
// keyCache.On("UpdateKeys").Return(0, nil).Run(runner)

// resolverFactory := ResolverFactory{
// UpdateInterval: types.Duration(100 * time.Millisecond),
// }

// if updater := resolverFactory.NewUpdater(keyCache); assert.NotNil(updater) {
// waitGroup := &sync.WaitGroup{}
// shutdown := make(chan struct{})
// updater.Run(waitGroup, shutdown)

// // we only care that the updater called UpdateKeys() at least once
// <-updateKeysCalled
// close(shutdown)
// waitGroup.Wait()
// }
// }

func TestResolverFactoryDefaultParser(t *testing.T) {
assert := assert.New(t)

Expand Down

0 comments on commit e370453

Please sign in to comment.