Skip to content

Commit c373116

Browse files
committed
Minor docs update and temporary disabled gh auth
1 parent 31e972c commit c373116

File tree

11 files changed

+42
-34
lines changed

11 files changed

+42
-34
lines changed

.changeset/great-dodos-share.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'rushdb-dashboard': patch
3+
'rushdb-core': patch
4+
'rushdb-docs': patch
5+
'@rushdb/javascript-sdk': patch
6+
'rushdb-website': patch
7+
---
8+
9+
Minor docs update and temporary disabled gh auth

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Setup pnpm
3434
uses: pnpm/action-setup@v4
3535
with:
36-
version: 9.1.0
36+
version: 10.1.0
3737

3838
- name: Setup Node.js
3939
uses: actions/setup-node@v4

docs/docs/working-with-rushdb-sdk/rushdb-sdk-intro.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@ type ApiConnectionConfig = {
4242
url: string;
4343
};
4444

45+
export type Logger = (payload: any) => void
46+
4547
type CommonUserProvidedConfig = {
46-
httpClient?: HttpClientInterface;
47-
timeout?: number;
48-
validator?: Validator;
49-
} & ApiConnectionConfig;
48+
httpClient?: HttpClientInterface
49+
timeout?: number
50+
logger?: Logger
51+
} & ApiConnectionConfig
5052

5153
export type UserProvidedConfig = CommonUserProvidedConfig;
5254
```

docs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
]
5353
},
5454
"engines": {
55-
"pnpm": "9",
55+
"pnpm": "10",
5656
"node": ">=18.0.0 <=22.x.x"
5757
}
5858
}

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
"rimraf": "^6.0.1",
4242
"typescript": "5.7.2"
4343
},
44-
"packageManager": "pnpm@9.1.0",
44+
"packageManager": "pnpm@10.1.0",
4545
"engines": {
46-
"pnpm": "9",
46+
"pnpm": "10",
4747
"node": ">=18.0.0 <=22.x.x"
4848
},
4949
"workspaces": [

platform/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
FROM node:18-alpine AS builder
33

44
# Install pnpm
5-
RUN npm install -g pnpm@9.1.0
5+
RUN npm install -g pnpm@10.1.0
66

77
# Set working directory
88
WORKDIR /app
@@ -68,7 +68,7 @@ COPY ../../package.json ../../pnpm-lock.yaml ../../pnpm-workspace.yaml ./
6868
COPY ./platform/core/package.json ./platform/core/package.json
6969

7070
# Install pnpm and production dependencies
71-
RUN npm install -g pnpm@9.1.0
71+
RUN npm install -g pnpm@10.1.0
7272
RUN pnpm install --prod --frozen-lockfile --no-optional
7373

7474
# Copy built files from builder

platform/core/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Before running the application, ensure that you have the following installed:
2020

2121
1. **PNPM**: Install PNPM globally by running:
2222
```bash
23-
npm install -g pnpm@9.1.0
23+
npm install -g pnpm@10.1.0
2424
```
2525
2. **Docker**: The application requires a running Docker instance to start the Neo4j database. Make sure Docker is installed and running on your machine.
2626

platform/core/src/dashboard/auth/providers/github/github.controller.ts

+4-7
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,9 @@ export class GithubOAuthController {
4646
@ApiTags('Auth')
4747
@CommonResponseDecorator(GetUserDto)
4848
@UseInterceptors(NeogmaTransactionInterceptor, NeogmaDataInterceptor, ChangeCorsInterceptor)
49-
async githubAuthRedirect(
50-
@TransactionDecorator() transaction: Transaction,
51-
@Query()
52-
params: { code: string; scope: string; authuser: string; prompt: string }
53-
) {
49+
async githubAuthRedirect(@TransactionDecorator() transaction: Transaction, @Query('code') code: string) {
5450
try {
55-
const user = await this.githubOAuthService.githubLogin(params.code, transaction)
51+
const user = await this.githubOAuthService.githubLogin(code, transaction)
5652

5753
if (!user) {
5854
throw new UnauthorizedException()
@@ -69,7 +65,8 @@ export class GithubOAuthController {
6965
token: this.authService.createToken(user)
7066
}
7167
} catch (e) {
72-
return new UnauthorizedException(e)
68+
// console.log(e)
69+
throw new UnauthorizedException()
7370
}
7471
}
7572
}

platform/core/src/dashboard/auth/providers/github/github.service.ts

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Injectable } from '@nestjs/common'
22
import { ConfigService } from '@nestjs/config'
3-
import { JwtService } from '@nestjs/jwt'
43
import axios from 'axios'
54
import { Transaction } from 'neo4j-driver'
65

@@ -15,6 +14,13 @@ type TGithubAuthData = {
1514
name: string
1615
}
1716

17+
type TGithubEmailsData = {
18+
email: string
19+
primary: boolean
20+
verified: boolean
21+
visibility: 'private' | null
22+
}[]
23+
1824
const GITHUB_TOKEN_URL = 'https://github.com/login/oauth/access_token'
1925
const GITHUB_OAUTH_URL = 'https://api.github.com/user'
2026

@@ -23,7 +29,6 @@ export class GithubOAuthService {
2329
constructor(
2430
private readonly userService: UserService,
2531
private readonly encryptionService: EncryptionService,
26-
private readonly jwtService: JwtService,
2732
private readonly configService: ConfigService
2833
) {}
2934

@@ -37,23 +42,18 @@ export class GithubOAuthService {
3742
const data = userResponse
3843

3944
// if user email is set to private
40-
if (!userResponse.email) {
41-
const { data: emailResponse } = await axios.get<
45+
if (!data?.email) {
46+
const { data: emailResponse } = await axios.get<TGithubEmailsData>(
47+
'https://api.github.com/user/emails',
4248
{
43-
email: string
44-
primary: boolean
45-
verified: boolean
46-
visibility: 'private' | null
47-
}[]
48-
>('https://api.github.com/user/emails', {
49-
headers: {
50-
Authorization: `Bearer ${accessToken}`
49+
headers: {
50+
Authorization: `Bearer ${accessToken}`
51+
}
5152
}
52-
})
53+
)
5354

5455
data.email = emailResponse.find((email) => email.primary)?.email
5556
}
56-
5757
return data
5858
}
5959

platform/core/src/dashboard/auth/providers/google/google.controller.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class GoogleOAuthController {
7272
token: this.authService.createToken(user)
7373
}
7474
} catch (e) {
75-
return new UnauthorizedException(e)
75+
throw new UnauthorizedException(e)
7676
}
7777
}
7878
}

platform/dashboard/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Before running the application, ensure the following are installed on your syste
2323
1. **Node.js**: Recommended version 18 or above.
2424
2. **PNPM**: Install PNPM globally by running:
2525
```bash
26-
npm install -g pnpm@9.1.0
26+
npm install -g pnpm@10.1.0
2727
```
2828

2929
## Environment Variable

0 commit comments

Comments
 (0)