Giter VIP home page Giter VIP logo

self.id's Introduction

SelfID

Monorepo for the SelfID SDK and reference application.

Installation

This monorepo uses Yarn workspaces, make sure to install it first if you don't already have it.

  1. yarn install to install the dependencies
  2. yarn build to build all the packages

Additional scripts

  • yarn lint to run the linter in all packages
  • yarn test to run tests in all packages
  • yarn docs to generate API documentation

Application

The SelfID application is available using Ceramic's mainnet on self.id and the Clay testnet on clay.self.id.

SDK

Packages

Self.ID packages are organized in the following stack:

┌─────────────────────────────┐ ┌─────────────┐
│          framework          │ │ 3box-legacy │
├─────────────┬─┬─────────────┤ └─────────────┘
├─────────────┤ ├─────────────┤
│    react    │ │ image-utils │
├─────────────┤ └─────────────┘
├─────────────┤
│     web     │
├─────────────┤
├─────────────┤
│    core     │
└─────────────┘
Name Description Version
@self.id/core Read public records in Node and browsers environments npm version
@self.id/web Read and write records in browsers environments npm version
@self.id/react React hooks and utilities for authentication and records interactions npm version
@self.id/image-utils Image utilities for Self.ID profiles npm version
@self.id/framework React framework for decentralized apps npm version
@self.id/3box-legacy Load legacy 3Box profiles npm version

Templates

Predefined setups using common technologies to build applications using the Self.ID SDK.

Name Description
next-notes-typescript Notes taking application setup using Next.js and TypeScript
webpack-basic Basic Webpack setup
webpack-basic-typescript Basic Webpack setup using TypeScript

Maintainers

License

The SDK packages, templates and apps are dual licensed under MIT and Apache 2.

self.id's People

Contributors

beauwilliams avatar decentralgabe avatar paullecam avatar ukstv avatar zachferland avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

self.id's Issues

invaliDid

image
I have tried to connect one of my MetaMask accounts to a local running self.id server, but this ocurred.
then I tried using another MetaMask accoun to connecto to an existing DID, which I selected the one that os shown in the imagen, but the same error ocurred.
What's going on? I'm I missing somenithg to load onto the ceramic daemoin?

Unexpected token at multiauth/assets/fortmatic.png

Description

Templates run fine if you clone the entire self.id repo and run them from the templates folder.

When attempting to run each template locally after cloning via npx degit ceramicstudio/self.id/templates/<tempate> <name>
I get the same error.

Invalid or unexpected token
<dir>/next-notes-typescript/node_modules/@self.id/multiauth/assets/fortmatic.png:1
�PNG

Technical Information

The templates are dependent on some other configuration inside the monorepo.

error on: npm run bootstrap

[email protected] bootstrap /home/mk/w/self.id
node scripts/bootstrap

Error: Validation Error: data.image should be object, data.background should be object
at Object.fetchJson (/home/mk/w/self.id/node_modules/@ceramicnetwork/http-client/lib/utils.js:18:15)

Show warning when not connected to mainnet

It's unclear when you're not connected to mainnet and attempting to link other network dids to your mainnet one instead of just wanting the already existing one. Indicate that the user is not on mainnet when connected so they only attempt to create DID profiles on mainnet for now. Probably related to #9 .

Steps to reproduce

  1. create did and migrate 3box to idx from mainnet
  2. reconnect wallet with network switched
  3. attempt to sign into did and return different one
  4. 3ID connect asks to migrate 3box profile but fails

import error of CommonJS modules

when I run npm dev:

SyntaxError: Named export 'EthereumAuthProvider' not found. The requested module '@3id/connect' is a CommonJS module, which may not support all module.exports as named exports.

Edits are not immediately effective

After you edit a profile, the content changes immediately. If you reload a page, it still displays old content. Checked on editing names and updating a banner.

Changed name, refreshed the page:
Screenshot 2021-05-18 at 16 14 33

Changed name again, refreshed the page:
Screenshot 2021-05-18 at 16 21 50

get internal DID instance for JOSE JWE JWS

Description

I am trying to follow this tutorial https://blog.ceramic.network/how-to-store-signed-and-encrypted-data-on-ipfs/ to
store JWE and JWS data into IPFS and I need to get the DID instance but my app is authenticated through self.ID and it looks like
the DID instance is private.

How can I combine both techniques?

Technical Information

Maybe just explain / document what would be the "right" way of using these two techniques together or expose the DID instance out of the self.id instance.

@self.id/web has issues installing in v0.4.3

Description

Provide a 2-3 sentence overview of the work to be done.
The installation with yarn fails in v0.4.3. Works fine in earlier. versions 0.4.2.

2022 09 21-22 36-Code package json — 2022-09-dpatron-experiments

Technical Information

Looks like there was a wrong import in the package for the dids depedancy.

Stale "successful edit" notification

Steps to reproduce:

  1. Connect
  2. Open edit profile dialog, change fields
  3. Submit the edits
  4. Open edit profile dialog
  5. HERE: Green splash for "Profile successfully saved!"
    It should be gone by now.

Screenshot 2021-05-19 at 10 24 13

Trying to "connect to an existing account" with no existing account hangs forever

To repro:

  • Go to self.id
  • Click "connect"
  • Select Metamask
  • Click "continue" when asked about the site accessing your personal data
  • When given the option to Connect to Existing ID or Create a new ID, click Connect to Existing ID
  • Nothing happens
  • wait
  • still nothing happens
  • Now try to click "Create a new ID"
  • A spinning circle loading icon appears next to the "create a new ID" text
  • wait
  • nothing ever happens

Notice how not only does clicking "connect to an existing account" seem to hang without doing anything, it also then makes it so the "create a new ID" button then will also hang.

next-notes-typescript error

Description

Following the README for next-notes-template, I follow each step exactly and when i hit:
yarn run publish-model

I get the following:

yarn run v1.22.17
$ node --experimental-json-modules ./scripts/publish-model.mjs
node:internal/errors:465
    ErrorCaptureStackTrace(err);
    ^

TypeError [ERR_IMPORT_ASSERTION_TYPE_MISSING]: Module "file://[personal filesystem data redacted]/ceramic-template-app/node_modules/@glazed/devtools/node_modules/ajv/lib/refs/json-schema-secure.json" needs an import assertion of type "json"
    at new NodeError (node:internal/errors:372:5)
    at validateAssertions (node:internal/modules/esm/assert:82:15)
    at defaultLoad (node:internal/modules/esm/load:24:3)
    at ESMLoader.load (node:internal/modules/esm/loader:363:26)
    at ESMLoader.moduleProvider (node:internal/modules/esm/loader:282:22)
    at new ModuleJob (node:internal/modules/esm/module_job:66:26)
    at ESMLoader.#createModuleJob (node:internal/modules/esm/loader:301:17)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:260:34)
    at async ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:81:21)
    at async Promise.all (index 9) {
  code: 'ERR_IMPORT_ASSERTION_TYPE_MISSING'
}

Node.js v17.6.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.```

# Technical Information

It looks like a simple fix by adding an explicit assertion on the import line.

testing triage webhook once again.

Description

Provide a 2-3 sentence overview of the work to be done.

Technical Information

Provide an explanation of the technical work to be done.

Name is lost

While in #14 I whined about changes being not effective on the profile pane, now (2021-05-19) it goes into full discordance.

Profile is https://self.id/did:3:kjzl6cwe1jw14bgy1miryygnrf7mbl2598t1e8ziyk29cgfgigr6utkblokom5r

Actions before screenshot:

  1. Open profile with present name "Just a Hobbit"
  2. Changed the name to "Just a Hobbit For Gods Sake"
  3. Refreshed the window.
  4. Screenshot: Opened "Edit profile"

3id name banner: displays just DID "did:3:kjzl..."
Profile pane: "Just a Hobbit"
Edit dialog: "Just a Hobbit For Gods Sake"

Screenshot 2021-05-19 at 10 53 06

Just to be clear, I moved the dialog to the right via Chrome Dev Console to display all three names.

Connect dialog on edit after refresh

Steps:

  1. Open profile,
  2. Edit profile and populate it with something,
  3. Refresh the window
  4. Click on "Edit" button
  5. HERE: It asks me to sign in.

By itself, the behaviour is all right: private keys, entropy and such, but the app already knows my ID and my profile, so this is a bit confusing. Maybe add some explanation on top of the network/wallet selector?

Screenshot 2021-05-18 at 16 20 01

Loader error on @self.id/framework

Description

Hey guys, trying to implement the Profile id in our site but keep getting this error,

./node_modules/@self.id/framework/dist/lib.mjs 100:15
Module parse failed: Unexpected token (100:15)
File was processed with these loaders:
 * ./node_modules/react-scripts/node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|     ...i
|   } = e,
>         o = t ?? {},
|         c = r ?? {};
|   return a.createElement(g, { ...c

Technical Information

We use typescript and a simple create react app, with react-app-rewired.
I have copied the webpack-basic-typescript example, but this error is strange one.

Thanks in advance for any help.

Propagate save errors up to the user

I was having difficulty saving my profile. On the site all that showed was a "failed to save" error. In the console, there was only a POST 500 error with no description.

Only by going to the network debugging tab and clicking on the failed request was I able to see the validation error: "data/residenceCountry must NOT have more than 2 characters, data/residenceCountry must match pattern \"^[A-Z]{2}$\"".

I think validation errors should propagate up to the user and, if possible, be associated with the appropriate form field.

Also, the editing interface shouldn't close until it has successfully saved or the user hits cancel. As it is, everything has to be reentered when it fails to save.

Nuxt3 template

I was able to run Nuxt3 on Vite with TypeScript, @self.id/core and @self.id/web on the fifth try.

Are you interested in a working nuxt3 template ?

Add opengraph link preview to landing page

As a user, when I share the Self.ID landing page link (or the other deployments on testnet i.e. clay.self.id) on social mediums, I expect to see a basic metadata like page title, description, and image.

[import error of ESM]

Description

the project i created with create-react-app.

why import Provider is undefined ?

import { Provider } from "@self.id/react";

console.log('Provider', Provider)

Can't import the named export 'Provider' (imported as 'Provider') from default-exporting module (only default export is available)

"@self.id/react": "^0.2.0",
"@self.id/web": "^0.3.0",
import selfid from "@self.id/react";

console.log('selfid', selfid)

it's /static/media/lib.5cbed25f96df6e92ee98.cjs path. i didn't realdy understand. :(

Technical Information

Provide an explanation of the technical work to be done.

useViewerConnection hook doesn't re-connect after refresh

Description

Connecting a wallet using the useViewerConnection hook and a Provider. Refreshing the page, the connection of useViewerConnection never tries to re-connect.

Isn't this hook supposed to handle this connection lifecycle? My metamask wallet continues to say it's connected. And the useViewerID hook still properly pulls my id after refresh.

Result:

  1. Connect my metamask wallet using useViewerConnection.connect
    a. This works and connection status returns { status: 'connected', selfID: SelfID }. Cookies, etc. are set.
  2. Refresh the page
    a. useViewerConnection.connection is { status: 'idle' }

Expected:

  1. Connect my metamask wallet using useViewerConnection.connect
    a. This works and connection status returns {status: 'connected', selfID: SelfID}. Cookies, etc. are set.
  2. Refresh the page
    a. useViewerConnection.connection returns {status: 'connected', selfID: SelfID}

Technical Information

Version @self.id/framework: ^0.3.2
Re-calling connect puts some info into localStorage under 3idconnect.org - this is wiped on refresh

Example

import { useViewerID, useViewerConnection } from "@self.id/framework";

const MyComponent = () => {
  const [connection, connect, disconnect] = useViewerConnection();
  const viewerID = useViewerID();

  console.log(viewerID?.id);
  console.log(connection);

return ...
}

Absent warning for large image

Steps:

  1. Open profile,
  2. Edit profile,
  3. Select a large image for a banner.
  4. HERE: Expectation: Some warning about too big an image. Reality: Nothing.

Switching Eth networks still brings you to same profile

To repro:

  • Set metamask to be on Ropsten network
  • go to self.id, create a new profile
  • Update profile to set name
  • log out
  • go back to main self.id page
  • click "connect"
  • No prompt about whether you want to create a new ID or link to an existing
  • Get a prompt from metamask to sign a message to "Allow this account to control your identity"
  • Now you're brought to the same profile that was created before, as expected
  • Now log out again
  • Switch metamask to eth mainnet
  • Go back to root self.id page
  • Click connect
  • Get prompt to create a new ID or link to existing, select create a new ID
  • Sign message to "Allow this account to control your identity"
  • Sign message to "Link this account to your identity"
  • Get brought to the same account that was created on ropsten

Note that if you log out and log back in, the behavior through the login process is different depending on if you are on mainnet or ropsten. If you log in via the same eth network that the account was originally created on, there's no prompt about creating a new ID vs linking to an existing one, and there is also no need to sign the "link this account to your identity" message in metamask. But when connecting on a different eth network you get both those steps in the login flow, but then wind up at the same profile.

Note the extra steps to select new vs existing ID and to sign the extra message from metamask both seem to only happen the first time you log in with a new network. The subsequent login attempts behave the same as if you try to log in on the original network.

An example account I logged went through this process with: https://self.id/did:3:kjzl6cwe1jw14a27slbhxmfdinmaf55l9zeierq4lp4um4lbp3fzyossxndon6o

TypeError: ceramic.setDIDProvider is not a function

While trying to execute de bootstrap.js, this error was happening:
"TypeError: ceramic.setDIDProvider is not a function
at run (/home/pepe/Descargas/self.id-master/scripts/bootstrap.js:13:17)
at Object. (/home/pepe/Descargas/self.id-master/scripts/bootstrap.js:32:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47
"

record.content.name doesn't change on chainChanged event....

hey, first of all I need to ask whether I understand it correctly, that the user Id is being set for the particular chain, and not for every one?
For example if I set the id for the ethereum mainnet, there should be no name when I change to goerli for example, right?

If yes then the issue.. the name stays the same for any chain, tho it should be set to null or smth when the chain change.. I tried even deleting the cookie mannually tho, doesn't help

so on chain change I disconnect from the authProvider and connect to the new one again.. and I guess it should change the name also?... what do I do wrong could you tell please, thank you:)

maybe I should use State hook to store the authProvider there and interact with it in the chain change callback?))) ok I'll try it now

no, doesn't change anything..:(

it seems like the provider doesn't change inside of the ethereumAuthProvider.... when I change the chain, I still get the names from the prev chain, or still not getting anything, if there weren't any names in the prev chain

here's the logs and the code

doesn't change

const getProvider = async () => {
		try {
			disconnect();
			dispatch(setAccountName(''));
			dispatch(setDID(''));
			console.log('chain change event');
			console.log('Browser provider chainId', window.ethereum.chainId);

			if (!window.ethereum) throw new Error("Metamask isn't installed");
			await getChainId();

			const accounts = await window.ethereum.request({ method: 'eth_requestAccounts' });
			const authProvider = new EthereumAuthProvider(window.ethereum, accounts[0]);

			console.log('ethAuthProvider chain', (await authProvider.accountId()).chainId.reference);

			connect(authProvider);
			dispatch(setAccount(accounts[0]));
		} catch (error: any) {
			dispatch(setErrors([error]));

			if (error.code === -32002) await connectTheWallet();
		}
	};
	
useEffect(() => {
			window.ethereum.on('chainChanged', getProvider);
			
			return () => {
			window.ethereum?.removeListener('chainChanged', getProvider);
			}
			
			
},[])

and I use the top-level provider inside of my root nextjs layout.. if I try to use it inside of the separate page where I need to read the data from ceramic, I get the no QueryClientProvider error....

so how should I change the chainId inside of the ethAuthProvider? thank you

Profile updates are not being persisted

When saving an update to a profile it is not being persisted. Use the following steps to reproduce:

  1. Make sure you have a profile on 3box.io
  2. Log in to clay.self.id
  3. Update your profile picture and press save
  4. Log out of clay.self.id
  5. Log in to clay.self.id again
  6. You will now have your profile reverted to your first profile picture

I've also observed this on self.id. Not sure if this is an issue in self.id or 3id-connect, but on my profile I only see one commit in the basicProfile: https://gateway-clay.ceramic.network/api/v0/streams/kjzl6cwe1jw145cjbeko9kil8g9bxszjhyde21ob8epxuxkaon1izyqsu8wgcic

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.