Skip to content

Commit

Permalink
aid signed fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodolfo Miranda committed Aug 23, 2023
1 parent 5158f30 commit 1ddb673
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Project Name: signify-ts

[![TypeScript](https://badges.frapsoft.com/typescript/code/typescript.png?v=101)](https://github.com/ellerbrock/typescript-badges/)
[![Tests](https://github.com/WebOfTrust/signify-ts/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/WebOfTrust/signify-ts/actions/workflows/main.yml)
[![Tests](https://github.com/WebOfTrust/signify-ts/actions/workflows/main.yml/badge.svg?branch=development)](https://github.com/WebOfTrust/signify-ts/actions/workflows/main.yml)
[![codecov](https://codecov.io/gh/WebOfTrust/signify-ts/branch/main/graph/badge.svg?token=K3GK7MCYVW)](https://codecov.io/gh/WebOfTrust/signify-ts)
[![Documentation](https://img.shields.io/badge/documentation-grey?)](https://weboftrust.github.io/signify-ts/)

Expand Down
9 changes: 9 additions & 0 deletions test/app/signify.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,15 @@ describe('SignifyClient', () => {
assert.deepEqual(lastBody.rot.kt,['1','0'])
assert.equal(lastBody.rot.d,'EGFi9pCcRaLK8dPh5S7JP9Em62fBMiR1l4gW1ZazuuAO')

resp = await client.signedFetch('http://example.com','/test','POST',{foo:true},'aid1')
lastCall = fetchMock.mock.calls[fetchMock.mock.calls.length-1]!
assert.equal(lastCall[0]!,'http://example.com/test')
assert.equal(lastCall[1]!.method,'POST')
lastBody = JSON.parse(lastCall[1]!.body!)
assert.deepEqual(lastBody.foo,true)
lastHeaders = new Headers((lastCall[1]!.headers!))
assert.equal(lastHeaders.get('signify-resource'),'ELUvZ8aJEHAQE-0nsevyYTP98rBbGJUrTj5an-pCmwrK')

})

it('Salty identifiers', async () => {
Expand Down

0 comments on commit 1ddb673

Please sign in to comment.