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

Feature/rest api platform [DO NOT MERGE] #40

Closed
wants to merge 24 commits into from

Conversation

ahmed-deriv
Copy link
Collaborator

@ahmed-deriv ahmed-deriv commented Jan 21, 2025

Summary by Sourcery

Implement authentication and display user balance in the header.

New Features:

  • Added a login page to authenticate users.
  • Display the user's balance and currency in the header after login.

Tests:

  • Removed unnecessary tests.

Copy link

sourcery-ai bot commented Jan 21, 2025

Reviewer's Guide by Sourcery

This pull request refactors the authentication logic to use a more secure and robust approach. It removes the dependency on the Deriv API for authentication and introduces a new login mechanism using account ID and password. The changes also include improvements to error handling and session management.

Sequence diagram for the new login flow

sequenceDiagram
    actor User
    participant LoginPage
    participant AuthStore
    participant AuthService
    participant API

    User->>LoginPage: Enter credentials
    LoginPage->>AuthStore: startAuthorizing()
    LoginPage->>API: POST /login
    API-->>LoginPage: Return token
    LoginPage->>AuthStore: handleLoginSuccess(token)
    AuthStore->>AuthService: setToken(token)
    AuthService->>localStorage: Store token
    LoginPage->>API: GET /balance
    API-->>LoginPage: Return balance
    LoginPage->>User: Redirect to dashboard
Loading

Class diagram for the updated authentication system

classDiagram
    class AuthService {
        -instance: AuthService
        -TOKEN_KEY: string
        +getInstance(): AuthService
        +getStoredToken(): string
        +setToken(token: string): void
        +clearAuth(): void
        +isAuthenticated(): boolean
    }

    class AuthStore {
        +isAuthenticated: boolean
        +isAuthorizing: boolean
        +lastError: string
        +handleLoginSuccess(token: string)
        +handleLoginFailure(error: Error)
        +startAuthorizing()
        +logout()
        +clearError()
    }

    class ApiError {
        +message: string
        +status: number
        +code: string
    }

    AuthStore --> AuthService
    AuthError --|> Error
    NetworkError --|> ApiError
    AuthenticationError --|> ApiError
    TokenValidationError --|> AuthenticationError
Loading

File-Level Changes

Change Details Files
Refactor authentication service to remove Deriv API dependency.
  • Removed Deriv API calls for token validation and logout.
  • Removed token check and ping intervals.
  • Introduced a new method to set the token.
  • Modified clearAuth to remove session storage and clear cookies.
  • Added a method to check if the user is authenticated.
src/services/auth.service.ts
Update AuthStore to handle new authentication flow.
  • Removed the initialization logic.
  • Added methods to handle login success and failure.
  • Added a method to start the authorization process.
  • Added a method to clear errors.
  • Added a lastError property to store the last error message.
src/stores/AuthStore.ts
Update App component to remove auth initialization logic.
  • Removed the auth initialization logic.
  • Removed the AuthHandler component.
  • Added a loading fallback component.
  • Added a login page route.
  • Added a 404 page route.
  • Added a redirect to 404 for invalid routes.
src/App.tsx
Update Header component to reflect authentication changes.
  • Removed the isInitializing check.
  • Added a balance display.
  • Updated the login and logout button logic.
  • Added navigation to the login page.
src/components/Header/Header.tsx
Update Header styles.
  • Added styles for the balance display.
  • Added styles for the header right section.
  • Added styles for the header logo span.
  • Added styles for the header link active state.
src/components/Header/Header.scss
Update AppInitializer to remove auth initialization.
  • Removed the auth service initialization.
  • Added balance fetch on authentication.
src/app/AppInitializer.tsx
Remove unused utils.
  • Removed the getUrlBase method.
src/common/utils/index.tsx
Update ProtectedRoute to redirect to login page.
  • Redirect to the login page if the user is not authenticated.
src/components/ProtectedRoute/ProtectedRoute.tsx
Update rsbuild config.
  • Added a copy for the public folder.
  • Updated the dev server port.
  • Added inject body to the html config.
rsbuild.config.ts
Update index.html.
  • Updated the favicon link.
index.html
Update package.json.
  • Added axios dependency.
package.json
Add middleware for API requests.
  • Created an axios instance with enhanced security config.
  • Added request and response interceptors.
  • Added retry logic for failed requests.
  • Added error handling for different error types.
  • Added a generic API request function.
src/middleware/middleware.ts
Add login page styles.
  • Added styles for the login page.
src/pages/login/login.module.scss
Add login page component.
  • Added a login page component.
  • Added a form for account ID and password.
  • Added error handling for login failures.
  • Added a redirect to the dashboard on successful login.
src/pages/login/index.tsx
Add error types.
  • Added custom error classes for API errors, network errors, authentication errors, timeout errors, and validation errors.
src/types/errors.ts
Add API endpoints.
  • Added login and balance endpoints.
  • Added logic to store the token on login.
  • Added logic to update the balance store on balance fetch.
src/api/endpoints.ts
Add retry utils.
  • Added functions for calculating backoff, checking if a request should be retried, and waiting for a specified time.
src/utils/retry.ts
Add API config.
  • Added configuration for the API base URL, timeout, max retries, max content length, retry status codes, and headers.
  • Added configuration for the auth token key, xsrf cookie name, and xsrf header name.
src/config/api.config.ts
Add balance store.
  • Added a balance store to manage the user's balance and currency.
src/stores/BalanceStore.ts
Add API types.
  • Added types for login credentials, login response, and balance response.
src/types/api.types.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

github-actions bot commented Jan 21, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails
npm/asynckit 0.4.0 🟢 3
Details
CheckScoreReason
Dangerous-Workflow⚠️ -1no workflows found
Maintained⚠️ 00 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
SAST⚠️ 0no SAST tool detected
Packaging⚠️ -1packaging workflow not detected
Pinned-Dependencies⚠️ -1no dependencies found
Binary-Artifacts🟢 10no binaries found in the repo
Code-Review⚠️ 0Found 0/24 approved changesets -- score normalized to 0
Token-Permissions⚠️ -1No tokens found
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Fuzzing⚠️ 0project is not fuzzed
Vulnerabilities🟢 100 existing vulnerabilities detected
License🟢 10license file detected
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Signed-Releases⚠️ -1no releases found
Security-Policy⚠️ 0security policy file not detected
npm/axios 1.7.9 🟢 5.9
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 5 issue activity found in the last 90 days -- score normalized to 10
Security-Policy🟢 10security policy file detected
Packaging⚠️ -1packaging workflow not detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Code-Review🟢 6Found 9/14 approved changesets -- score normalized to 6
Binary-Artifacts🟢 10no binaries found in the repo
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
License🟢 10license file detected
Pinned-Dependencies🟢 3dependency not pinned by hash detected -- score normalized to 3
Fuzzing⚠️ 0project is not fuzzed
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration
Signed-Releases⚠️ -1no releases found
SAST🟢 9SAST tool detected but not run on all commits
Vulnerabilities⚠️ 026 existing vulnerabilities detected
npm/combined-stream 1.0.8 🟢 3.2
Details
CheckScoreReason
Packaging⚠️ -1packaging workflow not detected
Code-Review⚠️ 1Found 3/24 approved changesets -- score normalized to 1
Dangerous-Workflow⚠️ -1no workflows found
Token-Permissions⚠️ -1No tokens found
Pinned-Dependencies⚠️ -1no dependencies found
Maintained⚠️ 00 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Binary-Artifacts🟢 10no binaries found in the repo
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Security-Policy⚠️ 0security policy file not detected
Vulnerabilities🟢 100 existing vulnerabilities detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Signed-Releases⚠️ -1no releases found
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
npm/delayed-stream 1.0.0 🟢 3
Details
CheckScoreReason
Packaging⚠️ -1packaging workflow not detected
Pinned-Dependencies⚠️ -1no dependencies found
Code-Review⚠️ 0Found 2/29 approved changesets -- score normalized to 0
Maintained⚠️ 00 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Dangerous-Workflow⚠️ -1no workflows found
Token-Permissions⚠️ -1No tokens found
Binary-Artifacts🟢 10no binaries found in the repo
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Security-Policy⚠️ 0security policy file not detected
License🟢 10license file detected
Vulnerabilities🟢 100 existing vulnerabilities detected
Fuzzing⚠️ 0project is not fuzzed
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Signed-Releases⚠️ -1no releases found
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
npm/follow-redirects 1.15.9 🟢 4.2
Details
CheckScoreReason
Security-Policy🟢 10security policy file detected
Code-Review⚠️ 0Found 2/23 approved changesets -- score normalized to 0
Binary-Artifacts🟢 10no binaries found in the repo
Maintained⚠️ 00 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Packaging⚠️ -1packaging workflow not detected
Token-Permissions🟢 10GitHub workflow tokens follow principle of least privilege
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Pinned-Dependencies⚠️ 2dependency not pinned by hash detected -- score normalized to 2
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Signed-Releases⚠️ -1no releases found
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
Vulnerabilities⚠️ 017 existing vulnerabilities detected
npm/form-data 4.0.1 🟢 5.4
Details
CheckScoreReason
Maintained🟢 40 commit(s) and 5 issue activity found in the last 90 days -- score normalized to 4
Packaging⚠️ -1packaging workflow not detected
Code-Review⚠️ 2Found 7/25 approved changesets -- score normalized to 2
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Binary-Artifacts🟢 10no binaries found in the repo
Token-Permissions🟢 10GitHub workflow tokens follow principle of least privilege
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Security-Policy⚠️ 0security policy file not detected
Fuzzing⚠️ 0project is not fuzzed
Vulnerabilities🟢 100 existing vulnerabilities detected
License🟢 10license file detected
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration
Signed-Releases⚠️ -1no releases found
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
npm/mime-db 1.52.0 🟢 4.5
Details
CheckScoreReason
Binary-Artifacts🟢 10no binaries found in the repo
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
CI-Tests🟢 56 out of 12 merged PRs checked by a CI test -- score normalized to 5
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Code-Review🟢 3Found 11/29 approved changesets -- score normalized to 3
Contributors🟢 10project has 18 contributing companies or organizations
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Dependency-Update-Tool⚠️ 0no update tool detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Maintained🟢 75 commit(s) and 4 issue activity found in the last 90 days -- score normalized to 7
Packaging⚠️ -1packaging workflow not detected
Pinned-Dependencies⚠️ 1dependency not pinned by hash detected -- score normalized to 1
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
Security-Policy🟢 4security policy file detected
Signed-Releases⚠️ -1no releases found
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Vulnerabilities🟢 100 existing vulnerabilities detected
npm/mime-types 2.1.35 🟢 3.9
Details
CheckScoreReason
Binary-Artifacts🟢 10no binaries found in the repo
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
CI-Tests🟢 87 out of 8 merged PRs checked by a CI test -- score normalized to 8
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Code-Review⚠️ 2Found 7/26 approved changesets -- score normalized to 2
Contributors🟢 10project has 24 contributing companies or organizations
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Dependency-Update-Tool⚠️ 0no update tool detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Maintained⚠️ 01 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Packaging⚠️ -1packaging workflow not detected
Pinned-Dependencies⚠️ 2dependency not pinned by hash detected -- score normalized to 2
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
Security-Policy🟢 4security policy file detected
Signed-Releases⚠️ -1no releases found
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Vulnerabilities🟢 100 existing vulnerabilities detected
npm/proxy-from-env 1.1.0 🟢 3.4
Details
CheckScoreReason
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Packaging⚠️ -1packaging workflow not detected
Maintained⚠️ 00 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Binary-Artifacts🟢 10no binaries found in the repo
Code-Review⚠️ 0Found 2/26 approved changesets -- score normalized to 0
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Security-Policy⚠️ 0security policy file not detected
Vulnerabilities🟢 100 existing vulnerabilities detected
License🟢 10license file detected
Fuzzing⚠️ 0project is not fuzzed
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
npm/axios ^1.7.9 🟢 5.9
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 5 issue activity found in the last 90 days -- score normalized to 10
Security-Policy🟢 10security policy file detected
Packaging⚠️ -1packaging workflow not detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Code-Review🟢 6Found 9/14 approved changesets -- score normalized to 6
Binary-Artifacts🟢 10no binaries found in the repo
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
License🟢 10license file detected
Pinned-Dependencies🟢 3dependency not pinned by hash detected -- score normalized to 3
Fuzzing⚠️ 0project is not fuzzed
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration
Signed-Releases⚠️ -1no releases found
SAST🟢 9SAST tool detected but not run on all commits
Vulnerabilities⚠️ 026 existing vulnerabilities detected

Scanned Manifest Files

package-lock.json
  • @adobe/css-tools@4.4.1
  • @ampproject/remapping@2.3.0
  • @babel/compat-data@7.26.5
  • @babel/core@7.26.0
  • @babel/generator@7.26.5
  • @babel/helper-compilation-targets@7.26.5
  • @babel/helper-module-imports@7.25.9
  • @babel/helper-module-transforms@7.26.0
  • @babel/helper-plugin-utils@7.26.5
  • @babel/helper-string-parser@7.25.9
  • @babel/helper-validator-option@7.25.9
  • @babel/helpers@7.26.0
  • @babel/parser@7.26.5
  • @babel/plugin-syntax-async-generators@7.8.4
  • @babel/plugin-syntax-bigint@7.8.3
  • @babel/plugin-syntax-class-properties@7.12.13
  • @babel/plugin-syntax-class-static-block@7.14.5
  • @babel/plugin-syntax-import-attributes@7.26.0
  • @babel/plugin-syntax-import-meta@7.10.4
  • @babel/plugin-syntax-json-strings@7.8.3
  • @babel/plugin-syntax-jsx@7.25.9
  • @babel/plugin-syntax-logical-assignment-operators@7.10.4
  • @babel/plugin-syntax-nullish-coalescing-operator@7.8.3
  • @babel/plugin-syntax-numeric-separator@7.10.4
  • @babel/plugin-syntax-object-rest-spread@7.8.3
  • @babel/plugin-syntax-optional-catch-binding@7.8.3
  • @babel/plugin-syntax-optional-chaining@7.8.3
  • @babel/plugin-syntax-private-property-in-object@7.14.5
  • @babel/plugin-syntax-top-level-await@7.14.5
  • @babel/plugin-syntax-typescript@7.25.9
  • @babel/template@7.25.9
  • @babel/traverse@7.26.5
  • @babel/types@7.26.5
  • @bcoe/v8-coverage@0.2.3
  • @cspotcode/source-map-support@0.8.1
  • @istanbuljs/load-nyc-config@1.1.0
  • @istanbuljs/schema@0.1.3
  • @jest/console@29.7.0
  • @jest/core@29.7.0
  • @jest/environment@29.7.0
  • @jest/expect@29.7.0
  • @jest/expect-utils@29.7.0
  • @jest/fake-timers@29.7.0
  • @jest/globals@29.7.0
  • @jest/reporters@29.7.0
  • @jest/schemas@29.6.3
  • @jest/source-map@29.6.3
  • @jest/test-result@29.7.0
  • @jest/test-sequencer@29.7.0
  • @jest/transform@29.7.0
  • @jest/types@29.6.3
  • @jridgewell/gen-mapping@0.3.8
  • @jridgewell/resolve-uri@3.1.2
  • @jridgewell/set-array@1.2.1
  • @jridgewell/sourcemap-codec@1.5.0
  • @jridgewell/trace-mapping@0.3.9
  • @jridgewell/trace-mapping@0.3.25
  • @sinclair/typebox@0.27.8
  • @sinonjs/fake-timers@10.3.0
  • @testing-library/dom@10.4.0
  • @testing-library/jest-dom@6.6.3
  • @testing-library/react@16.2.0
  • @testing-library/user-event@14.6.1
  • @tootallnate/once@2.0.0
  • @tsconfig/node10@1.0.11
  • @tsconfig/node12@1.0.11
  • @tsconfig/node14@1.0.3
  • @tsconfig/node16@1.0.4
  • @types/aria-query@5.0.4
  • @types/babel__core@7.20.5
  • @types/babel__generator@7.6.8
  • @types/babel__template@7.4.4
  • @types/babel__traverse@7.20.6
  • @types/graceful-fs@4.1.9
  • @types/istanbul-lib-coverage@2.0.6
  • @types/istanbul-lib-report@3.0.3
  • @types/istanbul-reports@3.0.4
  • @types/jest@29.5.14
  • @types/jsdom@20.0.1
  • @types/stack-utils@2.0.3
  • @types/tough-cookie@4.0.5
  • @types/yargs@17.0.33
  • @types/yargs-parser@21.0.3
  • abab@2.0.6
  • acorn@8.14.0
  • acorn-globals@7.0.1
  • acorn-walk@8.3.4
  • agent-base@6.0.2
  • ansi-escapes@4.3.2
  • ansi-regex@5.0.1
  • ansi-styles@5.2.0
  • anymatch@3.1.3
  • arg@4.1.3
  • argparse@1.0.10
  • aria-query@5.3.0
  • async@3.2.6
  • asynckit@0.4.0
  • axios@1.7.9
  • babel-jest@29.7.0
  • babel-plugin-istanbul@6.1.1
  • babel-plugin-jest-hoist@29.6.3
  • babel-preset-current-node-syntax@1.1.0
  • babel-preset-jest@29.6.3
  • balanced-match@1.0.2
  • brace-expansion@1.1.11
  • brace-expansion@2.0.1
  • browserslist@4.24.4
  • bs-logger@0.2.6
  • bser@2.1.1
  • buffer-from@1.1.2
  • camelcase@5.3.1
  • camelcase@6.3.0
  • chalk@4.1.2
  • chalk@3.0.0
  • ci-info@3.9.0
  • cjs-module-lexer@1.4.1
  • co@4.6.0
  • collect-v8-coverage@1.0.2
  • combined-stream@1.0.8
  • concat-map@0.0.1
  • convert-source-map@2.0.0
  • create-jest@29.7.0
  • create-require@1.1.1
  • css.escape@1.5.1
  • cssom@0.5.0
  • cssom@0.3.8
  • cssstyle@2.3.0
  • data-urls@3.0.2
  • decimal.js@10.4.3
  • dedent@1.5.3
  • delayed-stream@1.0.0
  • dequal@2.0.3
  • detect-newline@3.1.0
  • diff@4.0.2
  • diff-sequences@29.6.3
  • dom-accessibility-api@0.6.3
  • dom-accessibility-api@0.5.16
  • domexception@4.0.0
  • ejs@3.1.10
  • electron-to-chromium@1.5.84
  • emittery@0.13.1
  • entities@4.5.0
  • escape-string-regexp@2.0.0
  • escodegen@2.1.0
  • esprima@4.0.1
  • estraverse@5.3.0
  • esutils@2.0.3
  • execa@5.1.1
  • exit@0.1.2
  • expect@29.7.0
  • fast-json-stable-stringify@2.1.0
  • fb-watchman@2.0.2
  • filelist@1.0.4
  • find-up@4.1.0
  • follow-redirects@1.15.9
  • form-data@4.0.1
  • fs.realpath@1.0.0
  • fsevents@2.3.3
  • gensync@1.0.0-beta.2
  • get-package-type@0.1.0
  • get-stream@6.0.1
  • glob@7.2.3
  • globals@11.12.0
  • html-encoding-sniffer@3.0.0
  • html-escaper@2.0.2
  • http-proxy-agent@5.0.0
  • https-proxy-agent@5.0.1
  • human-signals@2.1.0
  • iconv-lite@0.6.3
  • import-local@3.2.0
  • imurmurhash@0.1.4
  • inflight@1.0.6
  • is-core-module@2.16.1
  • is-generator-fn@2.1.0
  • is-potential-custom-element-name@1.0.1
  • is-stream@2.0.1
  • istanbul-lib-coverage@3.2.2
  • istanbul-lib-instrument@5.2.1
  • istanbul-lib-instrument@6.0.3
  • istanbul-lib-report@3.0.1
  • istanbul-lib-source-maps@4.0.1
  • istanbul-reports@3.1.7
  • jake@10.9.2
  • jest@29.7.0
  • jest-changed-files@29.7.0
  • jest-circus@29.7.0
  • jest-cli@29.7.0
  • jest-config@29.7.0
  • jest-diff@29.7.0
  • jest-docblock@29.7.0
  • jest-each@29.7.0
  • jest-environment-jsdom@29.7.0
  • jest-environment-node@29.7.0
  • jest-get-type@29.6.3
  • jest-haste-map@29.7.0
  • jest-leak-detector@29.7.0
  • jest-matcher-utils@29.7.0
  • jest-message-util@29.7.0
  • jest-mock@29.7.0
  • jest-pnp-resolver@1.2.3
  • jest-regex-util@29.6.3
  • jest-resolve@29.7.0
  • jest-resolve-dependencies@29.7.0
  • jest-runner@29.7.0
  • jest-runtime@29.7.0
  • jest-snapshot@29.7.0
  • jest-transform-stub@2.0.0
  • jest-util@29.7.0
  • jest-validate@29.7.0
  • jest-watcher@29.7.0
  • jest-worker@29.7.0
  • js-yaml@3.14.1
  • jsdom@20.0.3
  • jsesc@3.1.0
  • kleur@3.0.3
  • leven@3.1.0
  • locate-path@5.0.0
  • lodash.memoize@4.1.2
  • lru-cache@5.1.1
  • make-dir@4.0.0
  • make-error@1.3.6
  • makeerror@1.0.12
  • mime-db@1.52.0
  • mime-types@2.1.35
  • mimic-fn@2.1.0
  • min-indent@1.0.1
  • minimatch@5.1.6
  • minimatch@3.1.2
  • natural-compare@1.4.0
  • node-int64@0.4.0
  • node-releases@2.0.19
  • normalize-path@3.0.0
  • npm-run-path@4.0.1
  • nwsapi@2.2.16
  • once@1.4.0
  • onetime@5.1.2
  • p-limit@2.3.0
  • p-limit@3.1.0
  • p-locate@4.1.0
  • p-try@2.2.0
  • parse-json@5.2.0
  • parse5@7.2.1
  • path-exists@4.0.0
  • path-is-absolute@1.0.1
  • path-parse@1.0.7
  • pirates@4.0.6
  • pkg-dir@4.2.0
  • pretty-format@29.7.0
  • pretty-format@27.5.1
  • prompts@2.4.2
  • proxy-from-env@1.1.0
  • psl@1.15.0
  • punycode@2.3.1
  • pure-rand@6.1.0
  • querystringify@2.2.0
  • react-is@18.3.1
  • react-is@17.0.2
  • redent@3.0.0
  • requires-port@1.0.0
  • resolve@1.22.10
  • resolve-cwd@3.0.0
  • resolve.exports@2.0.3
  • safer-buffer@2.1.2
  • saxes@6.0.0
  • semver@6.3.1
  • signal-exit@3.0.7
  • sisteransi@1.0.5
  • slash@3.0.0
  • source-map-support@0.5.13
  • sprintf-js@1.0.3
  • stack-utils@2.0.6
  • string-length@4.0.2
  • strip-bom@4.0.0
  • strip-final-newline@2.0.0
  • strip-indent@3.0.0
  • strip-json-comments@3.1.1
  • supports-color@7.2.0
  • supports-preserve-symlinks-flag@1.0.0
  • symbol-tree@3.2.4
  • test-exclude@6.0.0
  • tmpl@1.0.5
  • tough-cookie@4.1.4
  • tr46@3.0.0
  • ts-jest@29.2.5
  • ts-node@10.9.2
  • type-fest@0.21.3
  • universalify@0.2.0
  • update-browserslist-db@1.1.2
  • url-parse@1.5.10
  • v8-compile-cache-lib@3.0.1
  • v8-to-istanbul@9.3.0
  • w3c-xmlserializer@4.0.0
  • walker@1.0.8
  • webidl-conversions@7.0.0
  • whatwg-encoding@2.0.0
  • whatwg-mimetype@3.0.0
  • whatwg-url@11.0.0
  • wrappy@1.0.2
  • write-file-atomic@4.0.2
  • ws@8.18.0
  • xml-name-validator@4.0.0
  • xmlchars@2.2.0
  • yallist@3.1.1
  • yn@3.1.1
  • yocto-queue@0.1.0
package.json
  • @testing-library/jest-dom@^6.6.3
  • @testing-library/react@^16.2.0
  • @testing-library/user-event@^14.6.1
  • @types/jest@^29.5.14
  • axios@^1.7.9
  • jest@^29.7.0
  • jest-environment-jsdom@^29.7.0
  • jest-transform-stub@^2.0.0
  • ts-jest@^29.2.5
  • ts-node@^10.9.2

@ahmed-deriv ahmed-deriv changed the title Feature/rest api platform Feature/rest api platform [DO NOT MERGE] Jan 21, 2025
Copy link

✨ Preview deployment is ready!

🔗 Preview URL: https://trade-rise-fall-h2frf49dt.binary.sx
📝 Commit: ecfc7e2
🕒 Deployed at: 2025-01-21T07:18:53.804Z

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @ahmed-deriv - I've reviewed your changes and found some issues that need to be addressed.

Blocking issues:

  • Add token validation before storage (link)

Overall Comments:

  • Consider adding JSDoc comments to document the public APIs in the service and store classes to improve maintainability
  • What is the session management strategy now that the token validation check interval has been removed? Consider documenting the approach
Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🔴 Security: 1 blocking issue
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@vinu-deriv vinu-deriv closed this Jan 23, 2025
@vinu-deriv vinu-deriv deleted the feature/RestAPI-Platform branch January 23, 2025 08:53
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