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

Make session signatures compatible with SIWE ReCap #18

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 9 additions & 6 deletions cypress/e2e/spec.cy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// @ts-nocheck

import { SessionCapabilityObject } from '@lit-protocol/auth';

let window: any;
let savedParams: any = {
accs: [
Expand Down Expand Up @@ -722,12 +724,13 @@ describe('Session', () => {
);

let resources = [`litSigningCondition://${hashedResourceId}`];

let capabilities = savedParams.litNodeClient.getSessionCapabilities(
[],
resources
let capabilityObject = savedParams.litNodeClient.getSessionCapabilityObject(
resources,
new SessionCapabilityObject()
);
expect(capabilityObject.getCapableActionsForAllResources()[0]).to.be.eq(
'litSigningCondition'
);
expect(capabilities[0]).to.be.eq('litSigningConditionCapability://*');
});

it('gets expiration', () => {
Expand Down Expand Up @@ -806,4 +809,4 @@ describe('Session', () => {
// await cy.get('#metamask').click();
// // expect(sessionSigs).to.be.eq(1);
// });
});
});
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"g": "^2.0.1",
"ipfs-unixfs-importer": "^12.0.0",
"jszip": "^3.10.1",
"js-base64": "^3.7.2",
"lit-connect-modal": "0.1.8",
"lit-siwe": "^1.1.8",
"multiformats": "^10.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/access-control-conditions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
],
"main": "./dist/src/index.js",
"typings": "./dist/src/index.d.ts"
}
}
2 changes: 1 addition & 1 deletion packages/auth-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
],
"main": "./dist/src/index.js",
"typings": "./dist/src/index.d.ts"
}
}
3 changes: 0 additions & 3 deletions packages/auth-browser/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@ export * from './lib/auth-browser';
export * as ethConnect from './lib/chains/eth';
export * as cosmosConnect from './lib/chains/cosmos';
export * as solConnect from './lib/chains/sol';

// -- session management
export * from './lib/session';
248 changes: 0 additions & 248 deletions packages/auth-browser/src/lib/session.ts

This file was deleted.

10 changes: 10 additions & 0 deletions packages/auth/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"presets": [
[
"@nrwl/web/babel",
{
"useBuiltIns": "usage"
}
]
]
}
18 changes: 18 additions & 0 deletions packages/auth/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}
Empty file added packages/auth/LICENSE.md
Empty file.
16 changes: 16 additions & 0 deletions packages/auth/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Quick Start

### node.js / browser

```
yarn add @lit-protocol/auth
```

### Vanilla JS (UMD)

```js
<script src="https://cdn.jsdelivr.net/npm/@lit-protocol/auth-vanilla/auth.js"></script>
<script>
console.log(LitJsSdk_auth);
</script>
```
11 changes: 11 additions & 0 deletions packages/auth/babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"presets": [
[
"@nrwl/web/babel",
{
"useBuiltIns": "usage"
}
]
]
}

15 changes: 15 additions & 0 deletions packages/auth/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* eslint-disable */
export default {
displayName: 'auth',
preset: '../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
transform: {
'^.+\\.[tj]s$': 'ts-jest',
},
moduleFileExtensions: ['ts', 'js', 'html'],
coverageDirectory: '../../coverage/packages/auth',
};
Loading