Skip to content

Commit e1025d1

Browse files
committed
update to api 0.11
1 parent eee0e96 commit e1025d1

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module github.com/oidc-mytoken/lib
22

33
go 1.13
44

5-
require github.com/oidc-mytoken/api v0.10.0
5+
require github.com/oidc-mytoken/api v0.11.1

go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
22
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
33
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
4-
github.com/oidc-mytoken/api v0.10.0 h1:+LCMb7et/roU+Baifho9bcOOAoqDzMSOJt4T1EgI5nk=
5-
github.com/oidc-mytoken/api v0.10.0/go.mod h1:DS2/0gUjt84jVq/4jqs7mSoUtv1DDEp3xexF7HW1qe4=
4+
github.com/oidc-mytoken/api v0.11.1 h1:znpLzfXruM627lH0bjxoJEMRv2fCWptXmlqFRUjgwQ0=
5+
github.com/oidc-mytoken/api v0.11.1/go.mod h1:bd7obYvztiIQW1PoRVBTOg8/clWlauNGwcZEu5mRbwg=
66
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
77
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
88
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@@ -13,8 +13,8 @@ github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpE
1313
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
1414
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
1515
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
16-
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
17-
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
16+
github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
17+
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
1818
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
1919
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
2020
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

tokeninfo.go

+3-7
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,15 @@ func (info TokeninfoEndpoint) Introspect(mytoken string) (*api.TokeninfoIntrospe
3434
return &resp, nil
3535
}
3636

37-
// APIHistory obtains the event history for the passed mytoken or mom id.
37+
// APIHistory obtains the event history for the passed mytoken or mom ids.
3838
// If the used mytoken changes (due to token rotation), the new mytoken is included in the api.TokeninfoHistoryResponse
39-
func (info TokeninfoEndpoint) APIHistory(mytoken string, momID ...string) (
39+
func (info TokeninfoEndpoint) APIHistory(mytoken string, momIDs ...string) (
4040
resp api.TokeninfoHistoryResponse, err error,
4141
) {
42-
var mom string
43-
if len(momID) > 0 {
44-
mom = momID[0]
45-
}
4642
req := api.TokenInfoRequest{
4743
Action: api.TokeninfoActionEventHistory,
4844
Mytoken: mytoken,
49-
MOMID: mom,
45+
MOMIDs: momIDs,
5046
}
5147
err = info.DoHTTPRequest("POST", req, &resp)
5248
return

0 commit comments

Comments
 (0)