Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hash App token #6724

Merged
merged 34 commits into from
May 4, 2019
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
251d258
hashTokens
techknowlogick Apr 19, 2019
0ef8631
add to vendor
techknowlogick Apr 19, 2019
743fdad
sdk changes
techknowlogick Apr 19, 2019
892afcd
make lint
techknowlogick Apr 19, 2019
4367118
Merge branch 'master' into fix-3789
techknowlogick Apr 23, 2019
6e52eaa
Update token.go
techknowlogick Apr 23, 2019
563c24f
Update token.go
techknowlogick Apr 23, 2019
2eac502
update gomod
techknowlogick Apr 23, 2019
1111139
make fmt
techknowlogick Apr 23, 2019
2f246a8
Merge branch 'master' into fix-3789
techknowlogick Apr 23, 2019
7156e8b
salt tokens
techknowlogick Apr 23, 2019
ae2ef47
make fmt
techknowlogick Apr 23, 2019
6acf155
generate swagger
techknowlogick Apr 23, 2019
a394b34
empty last line in swagger
techknowlogick Apr 23, 2019
883e6e6
make vendor
techknowlogick Apr 23, 2019
bddd6df
typo
techknowlogick Apr 23, 2019
42db74a
update error message
techknowlogick Apr 23, 2019
8884d41
update tests
techknowlogick Apr 23, 2019
3801b79
fix fixtures
techknowlogick Apr 23, 2019
7856fbd
add log to migration
techknowlogick Apr 23, 2019
1c7d93c
use appropriate variable name
techknowlogick Apr 23, 2019
04109a1
update test
techknowlogick Apr 23, 2019
8632e57
add sliceError protections (slice bounds out of range)
techknowlogick Apr 23, 2019
9002fd6
Update token.go
techknowlogick Apr 24, 2019
894d260
Merge branch 'master' into fix-3789
techknowlogick Apr 24, 2019
90f97d1
Merge branch 'master' into fix-3789
techknowlogick Apr 24, 2019
fde3cb8
Merge branch 'master' into fix-3789
lunny Apr 27, 2019
c428544
update year
techknowlogick Apr 27, 2019
a39f7d0
update per changes to v78
techknowlogick Apr 27, 2019
e8fa8bc
Merge branch 'master' into fix-3789
techknowlogick May 2, 2019
e1b765f
updpate per v78 migration changes
techknowlogick May 2, 2019
b1c097f
Merge branch 'master' into fix-3789
techknowlogick May 3, 2019
2b49738
Merge branch 'master' into fix-3789
techknowlogick May 4, 2019
ed40913
Merge branch 'master' into fix-3789
techknowlogick May 4, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update tests
techknowlogick committed Apr 23, 2019
commit 8884d416412b08b5ae32b36e21ba3f19b2fec5f1
21 changes: 12 additions & 9 deletions models/fixtures/access_token.yml
Original file line number Diff line number Diff line change
@@ -2,28 +2,31 @@
id: 1
uid: 1
name: Token A
token: hashhash11111111
hashed_token: 63d5eede00e1e8e7f8a60af96ffbce5fd039084ad2dcdee4696d436e4c5382c0
token_last_eight: 11111111
token: d2c6c1ba3890b309189a8e618c72a162e4efbf36
token_hash: 2b3668e11cb82d3af8c6e4524fc7841297668f5008d1626f0ad3417e9fa39af84c268248b78c481daa7e5dc437784003494f
token_salt: QuSiZr1byZ
token_last_eight: e4efbf36
created_unix: 946687980
updated_unix: 946687980

-
id: 2
uid: 1
name: Token B
token: hashhash22222222
hashed_token: 31eb2a689c5a8ee708c7880da1123fb462915a0e0344c54f46904a6fe597d758
token_last_eight: 22222222
token: 4c6f36e6cf498e2a448662f915d932c09c5a146c
token_hash: 1a0e32a231ebbd582dc626c1543a42d3c63d4fa76c07c72862721467c55e8f81c923d60700f0528b5f5f443f055559d3a279
token_salt: Lfwopukrq5
token_last_eight: 9c5a146c
created_unix: 946687980
updated_unix: 946687980

-
id: 3
uid: 2
name: Token A
token: hashhash33333333
hashed_token: c9786f567ce95c8ab8ad2a24187338b35edb61fba01a02eacb8f70e157d1e385
token_last_eight: 33333333
token: 90a18faa671dc43924b795806ffe4fd169d28c91
token_hash: d6d404048048812d9e911d93aefbe94fc768d4876fdf75e3bef0bdc67828e0af422846d3056f2f25ec35c51dc92075685ec5
token_salt: 99ArgXKlQQ
token_last_eight: 69d28c91
created_unix: 946687980
updated_unix: 946687980
10 changes: 5 additions & 5 deletions models/token_test.go
Original file line number Diff line number Diff line change
@@ -29,12 +29,12 @@ func TestNewAccessToken(t *testing.T) {

func TestGetAccessTokenBySHA(t *testing.T) {
assert.NoError(t, PrepareTestDatabase())
token, err := GetAccessTokenBySHA("hashhash11111111")
token, err := GetAccessTokenBySHA("d2c6c1ba3890b309189a8e618c72a162e4efbf36")
assert.NoError(t, err)
assert.Equal(t, int64(1), token.UID)
assert.Equal(t, "Token A", token.Name)
assert.Equal(t, "63d5eede00e1e8e7f8a60af96ffbce5fd039084ad2dcdee4696d436e4c5382c0", token.TokenHash)
assert.Equal(t, "11111111", token.TokenLastEight)
assert.Equal(t, "2b3668e11cb82d3af8c6e4524fc7841297668f5008d1626f0ad3417e9fa39af84c268248b78c481daa7e5dc437784003494f", token.TokenHash)
assert.Equal(t, "e4efbf36", token.TokenLastEight)

token, err = GetAccessTokenBySHA("notahash")
assert.Error(t, err)
@@ -70,7 +70,7 @@ func TestListAccessTokens(t *testing.T) {

func TestUpdateAccessToken(t *testing.T) {
assert.NoError(t, PrepareTestDatabase())
token, err := GetAccessTokenBySHA("hashhash22222222")
token, err := GetAccessTokenBySHA("4c6f36e6cf498e2a448662f915d932c09c5a146c")
assert.NoError(t, err)
token.Name = "Token Z"

@@ -81,7 +81,7 @@ func TestUpdateAccessToken(t *testing.T) {
func TestDeleteAccessTokenByID(t *testing.T) {
assert.NoError(t, PrepareTestDatabase())

token, err := GetAccessTokenBySHA("hashhash22222222")
token, err := GetAccessTokenBySHA("4c6f36e6cf498e2a448662f915d932c09c5a146c")
assert.NoError(t, err)
assert.Equal(t, int64(1), token.UID)