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

User accounts #122

Merged
merged 148 commits into from
Jul 12, 2023
Merged

User accounts #122

merged 148 commits into from
Jul 12, 2023

Conversation

Lezek123
Copy link
Contributor

@Lezek123 Lezek123 commented Apr 26, 2023

Links

Documentation: https://github.com/Lezek123/orion/blob/user-accounts/docs/developer-guide/tutorials/authentication-api.md
OpenAPI readme: https://github.com/Lezek123/orion/tree/user-accounts/src/auth-server#readme
Deployed auth api playground: https://atlas-dev.joystream.org/orion-auth/playground/
Deployed authentication-secured Orion v2 api: https://atlas-dev.joystream.org/orion-api/graphql

Atlas-dev setup explaination

The current user account instance deployed to Atlas-dev makes use of less secure setup w.r.t. cookie authentication (Same-Site: none, Access-Control-Allow-Credentials: true).

This is to simplify the testing process, wihtout forcing Orion and Atlas to be deployed under the same domain, which should be the case once we deploy to production.

In order to be able to pass the cookie to https://atlas-dev.joystream.org/orion-api/graphql when making requests from Atlas, you should specify credentials: 'include' option in ApolloClient's HttpLink (see: https://www.apollographql.com/docs/react/networking/authentication/).

Similarly, to include the cookie when making requests to https://atlas-dev.joystream.org/orion-auth/api/v1, you should provide credentials: 'include' to fetch: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#sending_a_request_with_credentials_included

Flows

See: Authentication API interactions

@Lezek123 Lezek123 changed the base branch from master to orion-v3 June 15, 2023 08:30
@Lezek123 Lezek123 marked this pull request as ready for review June 15, 2023 08:31
@Lezek123 Lezek123 changed the title WIP: User accounts User accounts Jun 15, 2023
@ignazio-bovo ignazio-bovo merged commit d1b1589 into Joystream:orion-v3 Jul 12, 2023
ignazio-bovo pushed a commit that referenced this pull request Jul 20, 2023
* User accounts (#122)

* Initial commit

* Initial orion draft

* Hide private data

* Fix extendedChannels query

* docker-compose db config adjustments

* Fix ExtendedBasicChannelFields

* Add `video` view

* Storage, Membership and ChannelCreated mappings

* Channel events processing

* Video mappings + some generic fixes

* Mappings: Comments, reactions + some generic fixes

* Cleanup

* NFT mappings, some post-testing fixes

* Video views mutation

* Channel follows + video views improvements

* Channel/video reports

* Category filtering: Part 1

* State subscription

* Category filtering: Part 2 + some refactorization

* Category filtering: Part 3 - add missing views and operator auth

* mostViewedVideosConnection custom query + generic custom queries fixes

* Kill switch

* mostRecentChannels query

* channelNftCollectors query

* extendedVideoCategories query

* Fix AND-OR queries and "eq: null"

* Docker setup improvements

* Video hero

* Category featured videos

* Entity caching (overlay) refactorization

* Prettier

* Documentation, setup improvements, cleanup

* FIX: Save NextEntityIds

* Excludable content

* - Allow limiting the total number of cached entities
- Deployment manifest fixes
- Custom ARCHIVE_GATEWAY_URL instead of HOST/PORT
- Updated dependencies
- `processAssets` bug fix

* setVideoViewPerIpTimeLimit operator mutation

* Ephesus mappings WIP

* Fix conflicts with local Joystream docker setup

* Metadata-protobuf patch location fix

* Ephesus Atlas queries

* Update CHANGELOG

* Linting/formatting fixes, dead code removal

* Apps metaprotocol mappings

* Open auction topBid fix

* Fix metadata-protobuf patch

* Add signAppActionCommitment endpoint

* Tests: Basic data comparison script + bug fixes

* Remove channel-owned apps

* Remove Ephesus scope

* Apps as member-owned initial rework

* Fixes after compareState vs mainnet

* Remove lead-owned apps, fix typeorm-codegen patch

* AppAction support (Joystream/joystream#4631)

* Update CHANGELOG based on tests

* Allow controlling "is_censored" content exclusion via env

* buildExtendedChannelsQuery fix (activeVideosCount_gt: 0)

* Benchmarking script

* Benchmarking results

* Event queries optimalizations, fix gitignored v1 and v2 schemas

* Adjust autovacuum_analyze_scale_factor

* Fix entity cache cleanup

* Add index on event's `inExtrinsic` field

* Benchmarking round 2

* Fix req.ip reverse proxy issue, allow conditionally displaying excluded content in results

* Operator queries

* Update docs

* Prettier format

* Add CI checks

* Remove issue template, fix "workflows" location

* Disallow app deletion

* Update `generateAppActionCommitment` from `@joystream/js`

* Fix channel follows, video views and reports after operator queries

* Fix #82

* Comment notifications: Don't notify the author about their own comment

* Introduce a mechanism to preserve views, follows, reports and config data when updating the processor

* mostViewedVideosConnection missing params fix

* Fix assets encoding (AppAction)

* Assets url resolving

* Remove accidently commited file

* Fix Aquarium deployment

* Update CHANGELOG

* Improve caching speed and add more logs

* Latest apps-related updated (generateAppActionCommitment, mappings)

* Process member banning/unbanning

* Fix: Remove banned members when channel is removed

* Update migration

* State queries: Re-enable apps

* OpenAPI draft docs

* Auth API: Part 1 - Anonymous Auth

* Views: Add missing chanel/video related entities

* Excluding/restoring comments: Update:
- parentComment.repliesCount,
- parentComment.reactionsAndRepliesCount,
- video.commentsCount

* Operator queries: 401 Unauthorized, remove `x-display-hidden-entities` (operator just sees all hidden entities by default)

* Update changelog

* Simplify processor state subscription

* Prevent the same comment from being "excluded"/"restored" multiple times

* Small adjustments to docs and compareState script

* Orion v1 migration scripts

* New logic for comment exclusion

* Fix: Reference to `yarn` in package.json

* Increase interval of ProcessorStateRetriever from 100 ms to 1000 ms

* Auth API: Part 2 - Session extension and registration

* Auth API: Part 3 - Basic e-mail confirmation

* Auth API: Part 4 - Login and logout

* Auth API: Part 5 - Connect / disconnect Joystream account(s)

* Auth API: Part 6 - E-mail confirmation token re-send

* Auth API: Schema adjustments for signature sign-in

* Auth API: Encryption artifacts and related tests

* Auth API: Cookie authentication

* Auth API: Introduce rate limits and adjust proxy configuration

* Auth API: DROP ANY NOTION OF E-MAIL CONFIRMATION AND PASSWORD RESET

* Auth API: Max number of connected accounts and other data insertion limits

* Formatting

* Bring back e-mail confirmation features

* AuthAPI: OpenAPI playground, fixes, dev settings

* Auth API: Login - provide accountId in response

* Auth API: Fix GraphQL server cors config to allow testing

* Auth API: Update docs

* Auth API: Minor getSessionArtifacts response data fix

* Auth API: An attempt to fix CI tests

* Auth API: 2nd attempt to fix CI tests

* FIX: Set session cookie even if the session isn't new

* FIX: disconnect-account should not require signing

* Update developer guide + small package.json / Makefile fixes

* Fix OperatorOnly and add AccountOnly middleware

* Use `signatureVerify` instead of `sr25519Verify` to support external signer verification

* Add warning about `tests:auth-api` to the docs

* Fix link in README

* Auth API adjustmnets due to new schema, bug fixes, `accountData` query and docs updates

* Fix session artifacts unit test

* Fix docker build

* Fix generate-schema-file.sh

* Adjustments:
    - one-to-one rel between Gateway accs, Blockchain accs and Memberships,
    - bug fixes

* Operator guide + related developer guide adjustments

* Adjustments to facilitate Orion deployment, upgrading and maintenance

* Fix formatting, remove accidently commited files

* Connect follows, reports and views w/ users

* Use jsonl file as typegen input

* Remove usused patch

* Fix example env values in Operator guide

* Fix config values visibility issue

* 📝 Doc: update changelog for version 3.0.0 (#158)

* 📝 Doc: update changelog for version 3.0.0

* ✏️ Fix: add disable same site explainer

* 🩹 Improved changelog (#159)

* Update CHANGELOG.md

Remove docs directory structure

---------

Co-authored-by: Leszek Wiesner <leszek@jsgenesis.com>
malchililj pushed a commit to malchililj/orion that referenced this pull request Sep 3, 2024
* User accounts (Joystream#122)

* Initial commit

* Initial orion draft

* Hide private data

* Fix extendedChannels query

* docker-compose db config adjustments

* Fix ExtendedBasicChannelFields

* Add `video` view

* Storage, Membership and ChannelCreated mappings

* Channel events processing

* Video mappings + some generic fixes

* Mappings: Comments, reactions + some generic fixes

* Cleanup

* NFT mappings, some post-testing fixes

* Video views mutation

* Channel follows + video views improvements

* Channel/video reports

* Category filtering: Part 1

* State subscription

* Category filtering: Part 2 + some refactorization

* Category filtering: Part 3 - add missing views and operator auth

* mostViewedVideosConnection custom query + generic custom queries fixes

* Kill switch

* mostRecentChannels query

* channelNftCollectors query

* extendedVideoCategories query

* Fix AND-OR queries and "eq: null"

* Docker setup improvements

* Video hero

* Category featured videos

* Entity caching (overlay) refactorization

* Prettier

* Documentation, setup improvements, cleanup

* FIX: Save NextEntityIds

* Excludable content

* - Allow limiting the total number of cached entities
- Deployment manifest fixes
- Custom ARCHIVE_GATEWAY_URL instead of HOST/PORT
- Updated dependencies
- `processAssets` bug fix

* setVideoViewPerIpTimeLimit operator mutation

* Ephesus mappings WIP

* Fix conflicts with local Joystream docker setup

* Metadata-protobuf patch location fix

* Ephesus Atlas queries

* Update CHANGELOG

* Linting/formatting fixes, dead code removal

* Apps metaprotocol mappings

* Open auction topBid fix

* Fix metadata-protobuf patch

* Add signAppActionCommitment endpoint

* Tests: Basic data comparison script + bug fixes

* Remove channel-owned apps

* Remove Ephesus scope

* Apps as member-owned initial rework

* Fixes after compareState vs mainnet

* Remove lead-owned apps, fix typeorm-codegen patch

* AppAction support (Joystream/joystream#4631)

* Update CHANGELOG based on tests

* Allow controlling "is_censored" content exclusion via env

* buildExtendedChannelsQuery fix (activeVideosCount_gt: 0)

* Benchmarking script

* Benchmarking results

* Event queries optimalizations, fix gitignored v1 and v2 schemas

* Adjust autovacuum_analyze_scale_factor

* Fix entity cache cleanup

* Add index on event's `inExtrinsic` field

* Benchmarking round 2

* Fix req.ip reverse proxy issue, allow conditionally displaying excluded content in results

* Operator queries

* Update docs

* Prettier format

* Add CI checks

* Remove issue template, fix "workflows" location

* Disallow app deletion

* Update `generateAppActionCommitment` from `@joystream/js`

* Fix channel follows, video views and reports after operator queries

* Fix Joystream#82

* Comment notifications: Don't notify the author about their own comment

* Introduce a mechanism to preserve views, follows, reports and config data when updating the processor

* mostViewedVideosConnection missing params fix

* Fix assets encoding (AppAction)

* Assets url resolving

* Remove accidently commited file

* Fix Aquarium deployment

* Update CHANGELOG

* Improve caching speed and add more logs

* Latest apps-related updated (generateAppActionCommitment, mappings)

* Process member banning/unbanning

* Fix: Remove banned members when channel is removed

* Update migration

* State queries: Re-enable apps

* OpenAPI draft docs

* Auth API: Part 1 - Anonymous Auth

* Views: Add missing chanel/video related entities

* Excluding/restoring comments: Update:
- parentComment.repliesCount,
- parentComment.reactionsAndRepliesCount,
- video.commentsCount

* Operator queries: 401 Unauthorized, remove `x-display-hidden-entities` (operator just sees all hidden entities by default)

* Update changelog

* Simplify processor state subscription

* Prevent the same comment from being "excluded"/"restored" multiple times

* Small adjustments to docs and compareState script

* Orion v1 migration scripts

* New logic for comment exclusion

* Fix: Reference to `yarn` in package.json

* Increase interval of ProcessorStateRetriever from 100 ms to 1000 ms

* Auth API: Part 2 - Session extension and registration

* Auth API: Part 3 - Basic e-mail confirmation

* Auth API: Part 4 - Login and logout

* Auth API: Part 5 - Connect / disconnect Joystream account(s)

* Auth API: Part 6 - E-mail confirmation token re-send

* Auth API: Schema adjustments for signature sign-in

* Auth API: Encryption artifacts and related tests

* Auth API: Cookie authentication

* Auth API: Introduce rate limits and adjust proxy configuration

* Auth API: DROP ANY NOTION OF E-MAIL CONFIRMATION AND PASSWORD RESET

* Auth API: Max number of connected accounts and other data insertion limits

* Formatting

* Bring back e-mail confirmation features

* AuthAPI: OpenAPI playground, fixes, dev settings

* Auth API: Login - provide accountId in response

* Auth API: Fix GraphQL server cors config to allow testing

* Auth API: Update docs

* Auth API: Minor getSessionArtifacts response data fix

* Auth API: An attempt to fix CI tests

* Auth API: 2nd attempt to fix CI tests

* FIX: Set session cookie even if the session isn't new

* FIX: disconnect-account should not require signing

* Update developer guide + small package.json / Makefile fixes

* Fix OperatorOnly and add AccountOnly middleware

* Use `signatureVerify` instead of `sr25519Verify` to support external signer verification

* Add warning about `tests:auth-api` to the docs

* Fix link in README

* Auth API adjustmnets due to new schema, bug fixes, `accountData` query and docs updates

* Fix session artifacts unit test

* Fix docker build

* Fix generate-schema-file.sh

* Adjustments:
    - one-to-one rel between Gateway accs, Blockchain accs and Memberships,
    - bug fixes

* Operator guide + related developer guide adjustments

* Adjustments to facilitate Orion deployment, upgrading and maintenance

* Fix formatting, remove accidently commited files

* Connect follows, reports and views w/ users

* Use jsonl file as typegen input

* Remove usused patch

* Fix example env values in Operator guide

* Fix config values visibility issue

* 📝 Doc: update changelog for version 3.0.0 (Joystream#158)

* 📝 Doc: update changelog for version 3.0.0

* ✏️ Fix: add disable same site explainer

* 🩹 Improved changelog (Joystream#159)

* Update CHANGELOG.md

Remove docs directory structure

---------

Co-authored-by: Leszek Wiesner <leszek@jsgenesis.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants