Skip to content

Commit

Permalink
Merge branch 'master' into feat/ios
Browse files Browse the repository at this point in the history
  • Loading branch information
chaitanyapotti committed Jan 18, 2022
2 parents c33a4c7 + ec61888 commit d9e6306
Show file tree
Hide file tree
Showing 112 changed files with 8,203 additions and 2,952 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: Build and Deploy
strategy:
matrix:
node: ["14.x"]
node: ["16.x"]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}
Expand Down
17 changes: 11 additions & 6 deletions docs/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,23 @@ import ProductSuiteStack from "@theme/ProductSuiteStack";
import ProductSuiteGetStartedCards from "@theme/ProductSuiteGetStartedCards";
import TorusWalletGetStartedCards from "@theme/TorusWalletGetStartedCards";
import DirectAuthGetStartedCards from "@theme/DirectAuthGetStartedCards";
import Web3AuthCards from "@theme/Web3AuthCards";
import Web3AuthOverview from "@theme/Web3AuthOverview";

<ProductSuiteStack />
<Web3AuthOverview />

## Our products

<ProductSuiteGetStartedCards />
<br />

## Quick-start guides
## Explore Torus

<TorusWalletGetStartedCards />
- [Check out **How keys are secured**](/key-infrastructure/overview)
- [**Integrate with Web3Auth**](https://docs.web3auth.io)
- [**Plug in a Torus Wallet**](/wallet/get-started)

<DirectAuthGetStartedCards />
### References to Integration SDKs

<ProductSuiteGetStartedCards />

<br />

Expand Down
4 changes: 2 additions & 2 deletions docs/customauth/api-reference/initialization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Create and initialize a CustomAuth instance
This is the main class of anything related to CustomAuth SDK Using ES6,

```javascript
import DirectWebSdk from "@toruslabs/torus-direct-web-sdk";
import DirectWebSdk from "@toruslabs/customauth";
```

Then, create a new instance of Custom Auth.
Expand Down Expand Up @@ -255,7 +255,7 @@ await torusdirectsdk.init();

</TabItem>

<TabItem>
<TabItem value="skipSw">

```ts
await torusdirectsdk.init({ skipSw: true });
Expand Down
8 changes: 4 additions & 4 deletions docs/customauth/api-reference/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import TabItem from "@theme/TabItem";
<TabItem value="cdn">

```html
<script src="https://cdn.jsdelivr.net/npm/@toruslabs/torus-direct-web-sdk@4"></script>
<script src="https://cdn.jsdelivr.net/npm/@toruslabs/customauth@6"></script>
```

The script tag creates a `window.directWebSdk` object, which you can initialize.
Expand All @@ -30,15 +30,15 @@ The script tag creates a `window.directWebSdk` object, which you can initialize.
<TabItem value="npm">

```shell
npm i --save @toruslabs/torus-direct-web-sdk
npm i --save @toruslabs/customauth
```

</TabItem>

<TabItem value="yarn">

```shell
yarn add @toruslabs/torus-direct-web-sdk
yarn add @toruslabs/customauth
```

</TabItem>
Expand All @@ -57,7 +57,7 @@ yarn add @toruslabs/torus-direct-web-sdk
<TabItem value="basic">

```js
import DirectWebSdk from "@toruslabs/torus-direct-web-sdk";
import DirectWebSdk from "@toruslabs/customauth";

const torus = new DirectWebSdk({
baseUrl: "http://localhost:3000/serviceworker/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Compatibility and Common Patterns
---

The small API surface also means DirectAuth is composable - you can combine it
The small API surface also means CustomAuth is composable - you can combine it
with a meta-transaction flows, multisigs, and other cryptographic protocols.
It's easy to build on top of and generally we fit with most other technology
stacks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ encrypted private key on their servers. This ensures another layer of security
for the user since nobody can retrieve the private key unless they know the
password.

Combined with DirectAuth, we're able to replace the central server with Torus'
Combined with CustomAuth, we're able to replace the central server with Torus'
distributed architecture to allow us to make use of our distributed key
generation protocol to act as the initial randomness, which will be added to the
user's password to generate the user's private key.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ to consider implementing on a layer 2 solution.

---

DirectAuth is integrable with most \(if not all\) scalability solutions, no
CustomAuth is integrable with most \(if not all\) scalability solutions, no
matter the flavour. This includes, but is not limited to: Matic or other plasma
implementations, SKALE, Optimistic roll ups \(be it Arbitrium, Optimism or even
other chains\), state channels like Connext or even PoA networks.
Expand Down
8 changes: 4 additions & 4 deletions docs/customauth/compatibility-and-common-patterns/tkey.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ tKey manages private keys using the user’s device, private input, and wallet s
| `@tkey/share-serialization` | [![npm version](https://img.shields.io/npm/v/@tkey/share-serialization/latest.svg)](https://www.npmjs.com/package/@tkey/share-serialization/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@tkey/share-serialization/latest.svg)](https://bundlephobia.com/result?p=@tkey/share-serialization@latest) | Import/export a share from tKey |
| 🐉 **Torus** |
| `@tkey/default` | [![npm version](https://img.shields.io/npm/v/@tkey/default/latest.svg)](https://www.npmjs.com/package/@tkey/default/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@tkey/default/latest.svg)](https://bundlephobia.com/result?p=@tkey/default@latest) | Bundles `Core` and `Modules` into one importable package |
| `@tkey/service-provider-torus` | [![npm version](https://img.shields.io/npm/v/@tkey/service-provider-torus/latest.svg)](https://www.npmjs.com/package/@tkey/service-provider-torus/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@tkey/service-provider-torus/latest.svg)](https://bundlephobia.com/result?p=@tkey/service-provider-torus@latest) | `@service-provider-base` with DirectAuth functionality |
| `@tkey/service-provider-torus` | [![npm version](https://img.shields.io/npm/v/@tkey/service-provider-torus/latest.svg)](https://www.npmjs.com/package/@tkey/service-provider-torus/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@tkey/service-provider-torus/latest.svg)](https://bundlephobia.com/result?p=@tkey/service-provider-torus@latest) | `@service-provider-base` with CustomAuth functionality |
| `@tkey/storage-layer-torus` | [![npm version](https://img.shields.io/npm/v/@tkey/storage-layer-torus/latest.svg)](https://www.npmjs.com/package/@tkey/storage-layer-torus/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@tkey/storage-layer-torus/latest.svg)](https://bundlephobia.com/result?p=@tkey/storage-layer-torus@latest) | get/set metadata for various shares |
| 🐉 **Low-Level** |
| `@tkey/common-types` | [![npm version](https://img.shields.io/npm/v/@tkey/common-types/latest.svg)](https://www.npmjs.com/package/@tkey/common-types/v/latest) | [![minzip](https://img.shields.io/bundlephobia/minzip/@tkey/common-types/latest.svg)](https://bundlephobia.com/result?p=@tkey/common-types@latest) | Shared [TypeScript](https://www.typescriptlang.org/) Types |
Expand All @@ -34,7 +34,7 @@ tKey manages private keys using the user’s device, private input, and wallet s

### Pre-cursors

Before including the tKey SDK, we first need to setup [directAuth](https://github.com/torusresearch/torus-direct-web-sdk) for the Google logins etc... Below are several steps:
Before including the tKey SDK, we first need to setup [CustomAuth](https://github.com/torusresearch/customauth) for the Google logins etc... Below are several steps:

`npm i @tkey/default`

Expand All @@ -56,8 +56,8 @@ Packages who wish to use torus defaults can use `@tkey/default` to initialize
import ThresholdKey from "@tkey/default";
import WebStorageModule, { WEB_STORAGE_MODULE_NAME } from "@tkey/web-storage";

// Torus service provider uses directAuth to fetch users private key from the set of Torus nodes. This private key is one of the share in TSS.
// directAuth requires a deployment of a verifier with your clientId. Use developer.tor.us to create your verifier.
// Torus service provider uses customAuth to fetch users private key from the set of Torus nodes. This private key is one of the share in TSS.
// CustomAuth requires a deployment of a verifier with your clientId. Use developer.tor.us to create your verifier.
// Can use ServiceProviderBase which takes private key as input instead
const serviceProvider = new TorusServiceProvider({
directParams: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ RSA.
:::info

Also checkout
[Compatibility and Common Patterns ](./compatibility-and-common-patterns/)for
[Compatibility and Common Patterns ](compatibility-and-common-patterns/README) for
more on inspiration on how to use CustomAuth.

:::
2 changes: 1 addition & 1 deletion docs/customauth/examples.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Examples
---

Please refer to examples,
[vue.js](https://github.com/torusresearch/torus-direct-web-sdk/blob/master/examples/vue-app/src/App.vue),
[vue.js](https://github.com/torusresearch/customauth/blob/master/examples/vue-app/src/App.vue),
[gatsby](https://github.com/jamespfarrell/gatsby-torus-direct) for
configuration.

Expand Down
4 changes: 2 additions & 2 deletions docs/customauth/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,5 @@ web3.eth.accounts.privateKeyToAccount(PRIVATE_KEY);

Due to browser restrictions on popups, you should reduce the time taken between user interaction
and the login popups being opened. This is highly browser dependent, but the best practice for
this is to separate the initialization of the SDK (ie. `torusdirectsdk.init`) and the user login
method call (ie. `torusdirectsdk.triggerLogin` ).
this is to separate the initialization of the SDK (ie. `customauth.init`) and the user login
method call (ie. `customauth.triggerLogin` ).
18 changes: 9 additions & 9 deletions docs/customauth/get-started-old.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,32 @@ title: Get Started
hide_table_of_contents: true
---

Integrate DirectAuth into your applications today.
Integrate CustomAuth into your applications today.

:::info

Register at [http://register.directauth.io](http://register.directauth.io) to
Register at [https://developer.tor.us][https://developer.tor.us) to
get your verifier spun up today!

:::

Try our hosted example [here](https://vue-direct.tor.us).

To allow your web app to retrieve keys from the Torus Network, we'll be using
the [direct-web-sdk](https://github.com/torusresearch/torus-direct-web-sdk), the
the [custom-auth-sdk](https://github.com/torusresearch/customauth), the
repo itself has examples that you can also refer to:

1. Install the package `npm i @toruslabs/torus-direct-web-sdk`
1. Install the package `npm i @toruslabs/customauth`
2. Serve
[service worker](https://github.com/torusresearch/torus-direct-web-sdk/blob/master/serviceworker/sw.js)
[service worker](https://github.com/torusresearch/customauth/blob/master/serviceworker/sw.js)
from `baseUrl` where baseUrl is the one passed while instantiating
`DirectWebSdk` for specific login \(example
[http://localhost:3000/serviceworker/](http://localhost:3000/serviceworker/)\).
If you're already using a sw, pls ensure to port over the fetch override from
[our service worker](https://github.com/torusresearch/torus-direct-web-sdk/blob/master/serviceworker/sw.js)
[our service worker](https://github.com/torusresearch/customauth/blob/master/serviceworker/sw.js)
3. For browsers where service workers are not supported or if you wish to not
use service workers, create and serve
[redirect page](https://github.com/torusresearch/torus-direct-web-sdk/blob/master/serviceworker/redirect.html)
[redirect page](https://github.com/torusresearch/customauth/blob/master/serviceworker/redirect.html)
from `baseUrl/redirect` where baseUrl is the one passed while instantiating
`DirectWebSdk` for specific login \( example
[http://localhost:3000/serviceworker/](http://localhost:3000/serviceworker/)\)
Expand Down Expand Up @@ -65,7 +65,7 @@ If you're building a chrome extension or electron app, please set
window fails\)

For integration into other mobile, native or other platforms please refer to
[Integrating DirectAuth](integrating-customauth/).
[Integrating CustomAuth](integrating-customauth/).

## Registration

Expand Down Expand Up @@ -101,7 +101,7 @@ configure OAuth provider.

:::info

Register at [http://register.directauth.io](http://register.directauth.io) to
Register at [https://developer.tor.us](https://developer.tor.us) to
get your verifier spun up today!

:::
2 changes: 1 addition & 1 deletion docs/customauth/get-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ hide_table_of_contents: true
import GetStartedCards from "@theme/DirectAuthGetStartedCards";

Do everything you can do with OpenLogin and Wallet in a fully customizable way.
Built for developers whom want more control CustomAuth, gives the ability to build fully-customizable
Built for developers who want more control, CustomAuth gives users the ability to build fully-customizable
authentication experiences that leverage Torus' key infrastructure.

- [Check out **Integrating CustomAuth**](integrating-customauth)
Expand Down
4 changes: 2 additions & 2 deletions docs/customauth/integrating-customauth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Design a key management architecture that suites your user base.
Depending on your application's platform we have different SDKs for integrating
CustomAuth:

- [WebSDK in Javascript](https://github.com/torusresearch/torus-direct-web-sdk)
- [WebSDK in Javascript](https://github.com/torusresearch/customauth)
- [Android in Java SDK](https://github.com/torusresearch/torus-direct-android-sdk)
- [IOS Swift SDK](https://github.com/torusresearch/torus-direct-swift-sdk)
- [Native SDK in Java](https://github.com/torusresearch/torus-utils-java)
Expand All @@ -26,7 +26,7 @@ example code within their readme's.

The steps for integration are:

1. **[Designing your key management architecture](./#designing-your-key-management-architecture):** decide on which logins (verifiers) you'd like to implement, your authentication structure
1. **[Designing your key management architecture](designing-your-key-management-architecture):** decide on which logins (verifiers) you'd like to implement, your authentication structure
and more

2. **Deploying to testnet & implement**: once you've designed your key management architecture
Expand Down
4 changes: 2 additions & 2 deletions docs/customauth/integration-guidelines.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ a seamless experience for your application to onboard users.

---

It would be ideal for DirectAuth branding \(Image A\) to be located at the
It would be ideal for CustomAuth branding \(Image A\) to be located at the
bottom of your Sign in page \(Refer to Image B and C below\).

![Image A: DirectAuth branding (Light Mode)](/contents/directauth-logo.png)
![Image A: CustomAuth branding (Light Mode)](/contents/directauth-logo.png)

![Image B: Application Sign in (Pop Up)](/contents/app-signin-popup.png)

Expand Down
4 changes: 2 additions & 2 deletions docs/customauth/linking-accounts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Linking Accounts
---

DirectAuth supports the linking of user accounts from various identity
CustomAuth supports the linking of user accounts from various identity
providers. This allows a user to authenticate from any of their accounts and
still be recognized by your app and associated with the same public/private key.

Expand Down Expand Up @@ -43,7 +43,7 @@ link them, by first authenticating with the account they will be linking to.

## Common Unique Identifier

Several logins in DirectAuth have common datafields for users. For example,
Several logins in CustomAuth have common datafields for users. For example,
Google and traditional email logins share that they use email accounts to
identify a user. Take a look at
[Supported Logins](verifiers#supported-logins) for more
Expand Down
6 changes: 3 additions & 3 deletions docs/customauth/redirects-and-service-workers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ redirect url to retrieve the user data.
## Web

In
[torus-direct-web-sdk](https://github.com/torusresearch/torus-direct-web-sdk),
[customauth](https://github.com/torusresearch/customauth),
there are two ways to serve the redirect url

### Using service workers
Expand All @@ -27,7 +27,7 @@ serve a html page. The code present in the html communicates the query and hash
params to the underlying torus sdk which finishes the login process.

To use service workers, you need to serve the sw.js \(present in
`torus-direct-web-sdk` npm package\) from the baseUrl of your website \(eg: if
`customauth` npm package\) from the baseUrl of your website \(eg: if
`https://example.com/serviceworker/redirect` is your redirect uri, baseUrl would
be `https://example.com/serviceworker`\)

Expand All @@ -38,7 +38,7 @@ To know more about service workers, click

[Some browsers](https://caniuse.com/serviceworkers) don't support service
workers. For those browsers, you need to serve redirect.html \(present in
`torus-direct-web-sdk` npm package\) from the baseUrl as defined above.
`customauth` npm package\) from the baseUrl as defined above.

If you're facing problems with redirect being stuck, please refer to
[FAQ section](faq.mdx#my-redirect-page-is-stuck-in-ios-chrome)
Expand Down
2 changes: 1 addition & 1 deletion docs/customauth/verifiers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ also called authenticators.

---

DirectAuth deploys a custom Verifier Script for your application on the Torus
CustomAuth deploys a custom Verifier Script for your application on the Torus
Network. Verifier Scripts determine the access structure to your users keys and
the set Verifier Scripts chosen determine which logins your application will
ultimately use. You can read more about verifiers
Expand Down
6 changes: 3 additions & 3 deletions docs/customauth/what-is-customauth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ hide_table_of_contents: true
Do everything you can do with OpenLogin and Wallet in a fully customizable way. Built for developers whom want more control CustomAuth,
gives the ability to build fully-customizable authentication experiences that leverage Torus' key infrastructure. Some highlgihts of CustomAuth include:

- **SSO, passwordless, touch/faceID logins**: Almost all authentication flows are supported, a non comprehensive list can be found [here](verifiers/supported-logins)
- **SSO, passwordless, touch/faceID logins**: Almost all authentication flows are supported, a non comprehensive list can be found [here](verifiers#supported-logins)
- **Cross-platform**: Web/js and native Andriod/Java, iOS/Swift support
- **Blockchain agnostic**: hookup to almost all blockchains regardless of key type
- **Full control over UI**: unlike the plug n play solutions, CustomAuth gives the developer full control of the UI - no more popups
- **Custom login methods**: use existing and/or your own login system as authentication to the Torus Network
- **Non-custodial key management and storage**: leverage on the Torus Network to store and retrieve keys for your users
- **Non-custodial key management and storage**: leverage the Torus Network to store and retrieve keys for your users

:::info

Expand All @@ -30,7 +30,7 @@ longer pop-ups - applications literally own the UX and can implement their own
permissions structure. CustomAuth implements an interaction flow highlighted
[here](/key-infrastructure/role-of-torus-nodes/logins-key-assignments-and-retrievals).

![DirectAuth Architecture](/contents/directauth-overview.png)
![CustomAuth Architecture](/contents/directauth-overview.png)

Behind the scenes, just as how the Torus Wallet has a verifier script for each of the
authentication methods, this integration includes a deployment of a verifier
Expand Down
2 changes: 1 addition & 1 deletion docs/key-infrastructure/node-operators.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: List of Node Operators
Members of the Torus Network are validator nodes that operate the Distributed Key Generation, Proactive Secret Sharing and Key Assignment protocol, and consist of geographically distributed and diverse businesses institutions. The Torus Network exists to make their collective mission a reality: to create a simple key management store that empowers billions of people to leverage on the benefits of blockchain technology. Each Torus Node is represented on the Torus Network and governs its future.


<img height="500" style={{display:"block","margin-bottom":"20px", "margin-top":"20px", "margin-left": "auto", "margin-right": "auto"}} src="/images/torus-network.png"/>
<img style={{display:"block", maxHeight: "500px", margin:"20px auto"}} src="/images/torus-network.png"/>

In no particular order, current node operators are:
1. Binance
Expand Down
Loading

0 comments on commit d9e6306

Please sign in to comment.