Merge pull request #11559 from overleaf/jpa-access-token-encryptor-remove-v1

[access-token-encryptor] drop support for legacy v1 token scheme

GitOrigin-RevId: 2d32453ad38119fa45cfd77463091f2c91dfe647
This commit is contained in:
Jakob Ackermann
2023-02-02 18:22:42 +00:00
committed by Copybot
parent e63b90d288
commit 01aebbf69d
2 changed files with 10 additions and 36 deletions
@@ -72,18 +72,20 @@ describe('AccessTokenEncryptor', function () {
})
})
it('should decrypt an 2015 string to get the same object', function (done) {
it('should not be able to decrypt 2015 string', function (done) {
this.encryptor.decryptToJson(this.encrypted2015, (err, decrypted) => {
expect(err).to.be.null
expect(decrypted).to.deep.equal(this.testObject)
expect(err).to.exist
expect(err.message).to.equal('token scheme v1 is not supported anymore')
expect(decrypted).to.not.exist
done()
})
})
it('should decrypt an 2016 string to get the same object', function (done) {
it('should not be able to decrypt a 2016 string', function (done) {
this.encryptor.decryptToJson(this.encrypted2016, (err, decrypted) => {
expect(err).to.be.null
expect(decrypted).to.deep.equal(this.testObject)
expect(err).to.exist
expect(err.message).to.equal('token scheme v1 is not supported anymore')
expect(decrypted).to.not.exist
done()
})
})