Skip to content

Name change: Amplica Labs -> Project Liberty Labs #170

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

Merged
merged 8 commits into from
Aug 6, 2024
Merged
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
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
root: true,
// This tells ESLint to load the config from the package `eslint-config-custom`
extends: ['@amplica-labs/eslint-config-siwf'],
extends: ['@projectlibertylabs/eslint-config-siwf'],
};
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ jobs:
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install --filter @amplica-labs/siwf
run: pnpm install --filter @projectlibertylabs/siwf

- name: build
run: pnpm run build --filter @amplica-labs/siwf
run: pnpm run build --filter @projectlibertylabs/siwf

- name: Version Package
env:
Expand All @@ -115,7 +115,7 @@ jobs:

# Required for Granular Access Tokens
- name: NPM Access Config
run: npm config set //registry.npmjs.org/:_authToken ${{secrets.NODE_AUTH_TOKEN}}
run: npm config set //registry.npmjs.org/:_authToken ${{secrets.NPM_AUTH_TOKEN}}

- name: Publish on NPM @next
run: npm publish --verbose --tag next --access public
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ jobs:
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install --filter @amplica-labs/siwf
run: pnpm install --filter @projectlibertylabs/siwf

- name: build
run: pnpm run build --filter @amplica-labs/siwf
run: pnpm run build --filter @projectlibertylabs/siwf

- name: Version Package
if: env.TEST_RUN != 'true'
Expand All @@ -65,7 +65,7 @@ jobs:

# Required for Granular Access Tokens
- name: NPM Access Config
run: npm config set //registry.npmjs.org/:_authToken ${{secrets.NODE_AUTH_TOKEN}}
run: npm config set //registry.npmjs.org/:_authToken ${{secrets.NPM_AUTH_TOKEN}}

- name: Release on NPM @latest
if: env.TEST_RUN != 'true' && steps.is-full-release.outputs.is-full-release == 'true'
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2024 Amplica Labs
Copyright 2024 Project Liberty LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ onboarding operations over Frequency.

### Description

SIWF has two parts: a package `@amplica-labs/siwf` and a deployed web application that performs the needed UI for
SIWF has two parts: a package `@projectlibertylabs/siwf` and a deployed web application that performs the needed UI for
assisting the user in the action of login or onboarding. The UI also assists with interfacing with various wallets is
achieved through interaction with either a supported browser extension (web/mobile) or an installed native app (mobile
only)
Expand All @@ -33,25 +33,25 @@ onboarding. The user/data flows will look as follows:

### Creating a Sign-up/Sign-in Button

1. Install the SIWF package `npm i @amplica-labs/siwf`
1. Install the SIWF package `npm i @projectlibertylabs/siwf`

2. Import the `setConfig` and `getLoginOrRegistrationPayload` functions.
3. `setConfig` is used to set the URL to the current production siwf-ui. The current deployed environment is via GitHub
pages at:

```
https://amplicalabs.github.io/siwf/ui
https://projectlibertylabs.github.io/siwf/ui
```

Note: For SIWF development replace with the address the local application runs on.

```ts
import { type ControlPanelResponse, getLoginOrRegistrationPayload, setConfig } from '@amplica-labs/siwf';
import { type ControlPanelResponse, getLoginOrRegistrationPayload, setConfig } from '@projectlibertylabs/siwf';
setConfig({
// Your providerId
providerId: '1',
// The url where SIWF UI lives
proxyUrl: 'https://amplicalabs.github.io/siwf/ui',
proxyUrl: 'https://projectlibertylabs.github.io/siwf/ui',
// The Frequency RPC endpoint
frequencyRpcUrl: 'https://0.rpc.testnet.amplica.io',
siwsOptions: {
Expand Down Expand Up @@ -165,7 +165,7 @@ included in the sign-up.

### Returning User

This mean that a user has an MSA account and is a returning user to an application. This user has already granted
This means that a user has an MSA account and is a returning user to an application. This user has already granted
delegation and schemas permissions and is simply signing in.

```json
Expand Down Expand Up @@ -210,12 +210,12 @@ One of two objects will have data: `signUp` or `signIn`.

### Validating Response

It is nessisary to check the validity of the encoded payload as well as to keep track of the expiration of the grant
It is necessary to check the validity of the encoded payload as well as to keep track of the expiration of the grant
delegation. This helps with avoiding failed transactions due to expiration of signature for granting delegation. Methods
for decoding a hex-encoded extrinsic can be found in the
[Polkadot documentation](https://wiki.polkadot.network/docs/build-transaction-construction).

The `validateSignup` and `validateSignin` functions included in the `@amplica-labs/siwf` package performs validation
The `validateSignup` and `validateSignin` functions included in the `@projectlibertylabs/siwf` package performs validation
parameters to ensure the integrity and correctness of the process. It verifies several critical aspects of the provided
extrinsics or payload, including the validity and expiration of proofs, the consistency of signing keys, the format of
encoded data, and the matching of permissions with the provider's MSA ID.
Expand All @@ -225,7 +225,7 @@ encoded data, and the matching of permissions with the provider's MSA ID.
### Example

```ts
import { validateSignup } from '@amplica-labs/siwf';
import { validateSignup } from '@projectlibertylabs/siwf';
let response = {
signUp: {
extrinsics: [
Expand Down Expand Up @@ -280,7 +280,7 @@ See `SignupError` in [`packages/siwf/src/enums.ts`](packages/siwf/src/enums.ts)
### Example

```ts
import { validateSignin } from '@amplica-labs/siwf';
import { validateSignin } from '@projectlibertylabs/siwf';
let response = {
signIn: {
siwsPayload: {
Expand Down Expand Up @@ -324,7 +324,7 @@ See `SigninError` in [`packages/siwf/src/enums.ts`](packages/siwf/src/enums.ts)
At this point, it is up to you to create a session following best practices.

References for validation are live inside
[example-app](https://github.com/AmplicaLabs/siwf/tree/main/packages/example/src/lib/components/SignInVerification.svelte)
[example-app](https://github.com/ProjectLibertyLabs/siwf/tree/main/packages/example/src/lib/components/SignInVerification.svelte)

## Development Setup

Expand Down
23 changes: 12 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,31 @@
"description": "",
"scripts": {
"build": "pnpm run --stream -r build",
"build:utils": "pnpm run --filter @amplica-labs/siwf-utils -r build",
"build:siwf": "pnpm run --filter @amplica-labs/siwf -r build",
"pack:siwf": "pnpm run build:siwf && pnpm run --filter @amplica-labs/siwf -r pack",
"dev": "pnpm --filter @amplica-labs/siwf-ui run dev",
"build:utils": "pnpm run --filter @projectlibertylabs/siwf-utils -r build",
"build:siwf": "pnpm run --filter @projectlibertylabs/siwf -r build",
"pack:siwf": "pnpm run build:siwf && pnpm run --filter @projectlibertylabs/siwf -r pack",
"dev": "pnpm --filter @projectlibertylabs/siwf-ui run dev",
"lint": "pnpm run --stream -r lint",
"lint:app": "pnpm run --filter @amplica-labs/siwf-ui -r lint",
"lint:utils": "pnpm run --filter @amplica-labs/siwf-utils -r lint",
"lint:app": "pnpm run --filter @projectlibertylabs/siwf-ui -r lint",
"lint:utils": "pnpm run --filter @projectlibertylabs/siwf-utils -r lint",
"format:all": "pnpm run --stream -r format",
"format": "prettier --plugin-search-dir . --write .",
"format:check": "prettier --plugin-search-dir . --check .",
"test": "pnpm run --stream -r test",
"test:unit": "pnpm run --stream -r test:unit",
"proxy-wallet": "pnpm --filter @amplica-labs/siwf-ui",
"utils": "pnpm --filter @amplica-labs/siwf-utils",
"proxy-wallet": "pnpm --filter @projectlibertylabs/siwf-ui",
"utils": "pnpm --filter @projectlibertylabs/siwf-utils",
"chain-setup": "pnpm --filter setup run start"
},
"devDependencies": {
"@amplica-labs/eslint-config-siwf": "workspace:*",
"@projectlibertylabs/eslint-config-siwf": "workspace:*",
"eslint": "^8.56.0",
"prettier": "^3.2.4",
"prettier-plugin-svelte": "^3.1.2",
"vitest": "^1.4.0"
},
"keywords": [],
"author": "Amplica Labs",
"license": "Apache-2.0"
"author": "Project Liberty Labs",
"license": "Apache-2.0",
"packageManager": "[email protected]+sha1.d039b38e0b20ad012ed548e44267b8d4c88b447a"
}
2 changes: 1 addition & 1 deletion packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@amplica-labs/eslint-config-siwf",
"name": "@projectlibertylabs/eslint-config-siwf",
"version": "0.0.0",
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/example/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
extends: ['@amplica-labs/eslint-config-siwf'],
extends: ['@projectlibertylabs/eslint-config-siwf'],
};
8 changes: 4 additions & 4 deletions packages/example/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@amplica-labs/siwf-example-app",
"name": "@projectlibertylabs/siwf-example-app",
"version": "0.0.1",
"private": true,
"scripts": {
Expand All @@ -14,7 +14,7 @@
"test:unit": "echo \"example app empty test\""
},
"devDependencies": {
"@amplica-labs/eslint-config-siwf": "workspace:*",
"@projectlibertylabs/eslint-config-siwf": "workspace:*",
"@sveltejs/adapter-static": "^3.0.1",
"@sveltejs/kit": "^2.5.4",
"autoprefixer": "^10.4.17",
Expand All @@ -38,8 +38,8 @@
},
"type": "module",
"dependencies": {
"@amplica-labs/siwf": "workspace:^",
"@amplica-labs/siwf-utils": "workspace:^",
"@projectlibertylabs/siwf": "workspace:^",
"@projectlibertylabs/siwf-utils": "workspace:^",
"@dsnp/frequency-schemas": "^1.1.0",
"@frequency-chain/api-augment": "^1.11.0",
"@iconify/icons-openmoji": "^1.2.33",
Expand Down
2 changes: 1 addition & 1 deletion packages/example/src/lib/components/AccountCreator.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import '@frequency-chain/api-augment';
import { onMount } from 'svelte';
import { Keyring } from '@polkadot/api';
import { type SignUpResponse, validateSignup } from '@amplica-labs/siwf';
import { type SignUpResponse, validateSignup } from '@projectlibertylabs/siwf';
import type { ApiPromise } from '@polkadot/api/promise';
import Spinner from './Spinner.svelte';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import Icon from '@iconify/svelte';
import { parseMessage, type SignInResponse, type SiwsMessage } from '@amplica-labs/siwf';
import { parseMessage, type SignInResponse, type SiwsMessage } from '@projectlibertylabs/siwf';
import type { ApiPromise } from '@polkadot/api';
import SignInVerificationDetails from './SignInVerificationDetails.svelte';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import Icon from '@iconify/svelte';
import { getMsaId, isValidExpiration, isValidSignature, type SiwsMessage } from '@amplica-labs/siwf';
import { getMsaId, isValidExpiration, isValidSignature, type SiwsMessage } from '@projectlibertylabs/siwf';
import { onDestroy, onMount } from 'svelte';
import type { ApiPromise } from '@polkadot/api';

Expand Down
8 changes: 4 additions & 4 deletions packages/example/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
type RequestedSchema,
setConfig,
type WalletProxyResponse,
} from '@amplica-labs/siwf';
} from '@projectlibertylabs/siwf';
import SignInVerification from '$lib/components/SignInVerification.svelte';
import AccountCreator from '$lib/components/AccountCreator.svelte';
import { MultiSelect, type ObjectOption, type Option } from 'svelte-multiselect';
import { schemas } from '@dsnp/frequency-schemas/dsnp';
import Spinner from '../lib/components/Spinner.svelte';
import type { ApiPromise } from '@polkadot/api';
import { getApi, setApiUrl } from '@amplica-labs/siwf-utils';
import { getApi, setApiUrl } from '@projectlibertylabs/siwf-utils';

if (process.env.BUILD_TARGET === 'production') {
setConfig({
proxyUrl: 'https://amplicalabs.github.io/siwf/ui',
proxyUrl: 'https://projectlibertylabs.github.io/siwf/ui',
frequencyRpcUrl: 'https://0.rpc.frequency.xyz',
});
}
Expand Down Expand Up @@ -78,7 +78,7 @@
},
{
name: 'Production',
url: 'https://amplicalabs.github.io/siwf/ui',
url: 'https://projectlibertylabs.github.io/siwf/ui',
},
];

Expand Down
4 changes: 2 additions & 2 deletions packages/siwf/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@amplica-labs/siwf",
"name": "@projectlibertylabs/siwf",
"private": false,
"version": "0.0.0",
"type": "module",
Expand All @@ -26,7 +26,7 @@
"pack": "cd dist && npm pack"
},
"devDependencies": {
"@amplica-labs/eslint-config-siwf": "workspace:*",
"@projectlibertylabs/eslint-config-siwf": "workspace:*",
"@polkadot/rpc-provider": "^10.12.4",
"@vitest/coverage-v8": "^1.2.0",
"jsdom": "^23.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
extends: ['@amplica-labs/eslint-config-siwf'],
extends: ['@projectlibertylabs/eslint-config-siwf'],
};
8 changes: 4 additions & 4 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@amplica-labs/siwf-ui",
"name": "@projectlibertylabs/siwf-ui",
"version": "0.0.1",
"private": true,
"scripts": {
Expand All @@ -15,7 +15,7 @@
"test:unit": "vitest run"
},
"devDependencies": {
"@amplica-labs/eslint-config-siwf": "workspace:*",
"@projectlibertylabs/eslint-config-siwf": "workspace:*",
"@iconify/types": "^2.0.0",
"@playwright/test": "^1.28.1",
"@sveltejs/adapter-static": "^3.0.1",
Expand Down Expand Up @@ -43,8 +43,8 @@
"dependencies": {
"@dsnp/frequency-schemas": "^1.1.0",
"@frequency-chain/api-augment": "^1.11.0",
"@amplica-labs/siwf": "workspace:^",
"@amplica-labs/siwf-utils": "workspace:^",
"@projectlibertylabs/siwf": "workspace:^",
"@projectlibertylabs/siwf-utils": "workspace:^",
"@iconify/icons-ic": "^1.2.13",
"@iconify/icons-mdi": "^1.2.48",
"@iconify/svelte": "^3.1.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { type InjectedAccountWithExtensions } from '$lib/stores/derived/AllAccountsDerivedStore';
import type { MsaInfoWithAccounts } from '$lib/stores/derived/MsaAccountsDerivedStore';
import { type CurrentSelectedMsaAccount } from '$lib/stores/CurrentSelectedMsaAccountStore';
import { getHandleBase, getHandleSuffix } from '@amplica-labs/siwf-utils';
import { getHandleBase, getHandleSuffix } from '@projectlibertylabs/siwf-utils';
import WalletAddressSelector from './WalletAddressSelector.svelte';
import type { MsaAndAddress } from '$lib/stores/CachedLastUsedMsaAndAddressStore';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import type { InjectedAccountWithExtensions } from '$lib/stores/derived/AllAccountsDerivedStore';
import { formatWalletAddress } from '@amplica-labs/siwf-utils';
import { formatWalletAddress } from '@projectlibertylabs/siwf-utils';
import checkIcon from '@iconify/icons-mdi/check';
import Icon from '@iconify/svelte';

Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/lib/components/extensionsConfig.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ComponentType, SvelteComponent } from 'svelte';
import type { MsaInfo } from '@amplica-labs/siwf-utils';
import type { MsaInfo } from '@projectlibertylabs/siwf-utils';
import type { InjectedAccount } from '@polkadot/extension-inject/types';
import TalismanIcon from '../icons/TalismanRedIcon.svelte';
import PolkadotIcon from '../icons/Polkadot.svelte';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { writable } from 'svelte/store';
import { type MsaInfo } from '@amplica-labs/siwf-utils';
import { type MsaInfo } from '@projectlibertylabs/siwf-utils';
import type { InjectedAccountWithExtensions } from './derived/AllAccountsDerivedStore';

export interface CurrentSelectedMsaAccount extends MsaInfo {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/lib/stores/RequestResponseStore.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import '@frequency-chain/api-augment';
import type { EncodedExtrinsic, SignInRequest, SignInResponse, WalletProxyResponse } from '@amplica-labs/siwf-utils';
import type { EncodedExtrinsic, SignInRequest, SignInResponse, WalletProxyResponse } from '@projectlibertylabs/siwf-utils';
import { writable } from 'svelte/store';

export type AugmentedSignInRequest = SignInRequest & {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/lib/stores/SignupStore.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { checkHandleAvailability, getHandlePayload } from '$lib/utils';
import { validateHandle } from '@amplica-labs/siwf-utils';
import { validateHandle } from '@projectlibertylabs/siwf-utils';
import { writable } from 'svelte/store';

interface SignupStoreData {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
ExtensionErrorEnum,
type InjectedWeb3,
isExtensionInstalled,
} from '@amplica-labs/siwf-utils';
} from '@projectlibertylabs/siwf-utils';
import { derived } from 'svelte/store';
import { APP_NAME } from '$lib/globals';
import type { InjectedAccount } from '@polkadot/extension-inject/types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
AllAccountsDerivedStore,
type InjectedAccountWithExtensions,
} from './AllAccountsDerivedStore';
import { getMsaIds, getMsaInfo, type MsaInfo } from '@amplica-labs/siwf-utils';
import { getMsaIds, getMsaInfo, type MsaInfo } from '@projectlibertylabs/siwf-utils';
import { FilteredAccountsDerivedStore } from './FilteredAccountsDerivedStore';

export interface MsaInfoWithAccounts extends MsaInfo {
Expand Down
Loading