Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
dex
Commits
921090f0
Commit
921090f0
authored
Mar 17, 2017
by
rithu john
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
api: Update timestamp type for RefreshTokenRef to int64.
parent
84af5273
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
6 deletions
+17
-6
api.pb.go
api/api.pb.go
+0
-0
api.proto
api/api.proto
+2
-2
api.go
server/api.go
+3
-3
api_test.go
server/api_test.go
+12
-1
No files found.
api/api.pb.go
View file @
921090f0
This diff is collapsed.
Click to expand it.
api/api.proto
View file @
921090f0
...
...
@@ -105,8 +105,8 @@ message RefreshTokenRef {
// ID of the refresh token.
string
id
=
1
;
string
client_id
=
2
;
string
created_at
=
3
;
string
last_used
=
4
;
int64
created_at
=
5
;
int64
last_used
=
6
;
}
// ListRefreshReq is a request to enumerate the refresh tokens of a user.
...
...
server/api.go
View file @
921090f0
...
...
@@ -19,7 +19,7 @@ import (
// apiVersion increases every time a new call is added to the API. Clients should use this info
// to determine if the server supports specific features.
const
apiVersion
=
1
const
apiVersion
=
2
// NewAPI returns a server which implements the gRPC API interface.
func
NewAPI
(
s
storage
.
Storage
,
logger
logrus
.
FieldLogger
)
api
.
DexServer
{
...
...
@@ -226,8 +226,8 @@ func (d dexAPI) ListRefresh(ctx context.Context, req *api.ListRefreshReq) (*api.
r
:=
api
.
RefreshTokenRef
{
Id
:
session
.
ID
,
ClientId
:
session
.
ClientID
,
CreatedAt
:
session
.
CreatedAt
.
String
(),
LastUsed
:
session
.
LastUsed
.
String
(),
CreatedAt
:
session
.
CreatedAt
.
Unix
(),
LastUsed
:
session
.
LastUsed
.
Unix
(),
}
refreshTokenRefs
=
append
(
refreshTokenRefs
,
&
r
)
}
...
...
server/api_test.go
View file @
921090f0
...
...
@@ -146,10 +146,21 @@ func TestRefreshToken(t *testing.T) {
UserId
:
subjectString
,
}
if
_
,
err
:=
serv
.
ListRefresh
(
ctx
,
&
listReq
);
err
!=
nil
{
listResp
,
err
:=
serv
.
ListRefresh
(
ctx
,
&
listReq
)
if
err
!=
nil
{
t
.
Fatalf
(
"Unable to list refresh tokens for user: %v"
,
err
)
}
for
_
,
tok
:=
range
listResp
.
RefreshTokens
{
if
tok
.
CreatedAt
!=
r
.
CreatedAt
.
Unix
()
{
t
.
Errorf
(
"Expected CreatedAt timestamp %v, got %v"
,
r
.
CreatedAt
.
Unix
(),
tok
.
CreatedAt
)
}
if
tok
.
LastUsed
!=
r
.
LastUsed
.
Unix
()
{
t
.
Errorf
(
"Expected LastUsed timestamp %v, got %v"
,
r
.
LastUsed
.
Unix
(),
tok
.
LastUsed
)
}
}
revokeReq
:=
api
.
RevokeRefreshReq
{
UserId
:
subjectString
,
ClientId
:
r
.
ClientID
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment