Merge branch 'master' into serializing

# Conflicts:
#	example/internal/mock/storage.go
#	pkg/op/mock/storage.mock.go
#	pkg/op/storage.go
This commit is contained in:
Livio Amstutz 2020-10-15 11:19:20 +02:00
commit 8be8306511
6 changed files with 12 additions and 8 deletions

View file

@ -74,12 +74,12 @@ func CreateAccessToken(ctx context.Context, tokenRequest TokenRequest, accessTok
token, err = CreateJWT(ctx, creator.Issuer(), tokenRequest, exp, id, creator.Signer(), client, creator.Storage())
return
}
token, err = CreateBearerToken(id, creator.Crypto())
token, err = CreateBearerToken(id, authReq.GetSubject(), creator.Crypto())
return
}
func CreateBearerToken(id string, crypto Crypto) (string, error) {
return crypto.Encrypt(id)
func CreateBearerToken(tokenID, subject string, crypto Crypto) (string, error) {
return crypto.Encrypt(tokenID + ":" + subject)
}
func CreateJWT(ctx context.Context, issuer string, tokenRequest TokenRequest, exp time.Time, id string, signer Signer, client Client, storage Storage) (string, error) {