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

corrections auth page #187

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions docs/microservices-framework/authentication/jwt-authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,6 @@ In the case of an expired or invalid token, the client will receive a `401 Unaut
In our Express eventsource plugin, JWT Authentication is implemented using passport-jwt which is a strategy for authenticating with a JSON Web Token. To know more about, you can check [passport documentation](https://www.passportjs.org/)
:::

### Disabling JWT Authentication at Event Level

The plugins follow zero trust policy as a first principle, so if you have setup jwt spec at event source level, authentication for all the events will be true by default, unless you explicitly set authn:false in their event schema.
If you don't want users to be authenticated, you can disable any end-point by writing authn: false in your event schema like this:

```
http.get./helloworld:
fn: helloworld
authn: false
params:
- name: name
in: query
required: true
```

### Setup and implementation of JWT authentication in Godspeed.

### Step 1: Setting up Environment
Expand Down Expand Up @@ -97,6 +82,22 @@ JWT configuration is written under authn: in the event source's configuration fi
```
Once you have enabled it here, authentication will be true for all endpoints, unless you explicitly set authn:false in their event schema.


### Disabling JWT Authentication at Event Level

The plugins follow zero trust policy as a first principle, so if you have setup jwt spec at event source level, authentication for all the events will be true by default, unless you explicitly set authn:false in their event schema.
If you don't want users to be authenticated, you can disable any end-point by writing authn: false in your event schema like this:

```
http.get./helloworld:
fn: helloworld
authn: false
params:
- name: name
in: query
required: true
```

<details>
<summary> User Login Example using JWT Authentciation </summary>

Expand Down
208 changes: 0 additions & 208 deletions docs/microservices-framework/guide/get-started-full.md

This file was deleted.

90 changes: 72 additions & 18 deletions static/setup.bat
Original file line number Diff line number Diff line change
@@ -1,34 +1,88 @@
@echo off
SETLOCAL

echo Installing Node.js (version 18 or higher) and Git...
echo Installing Node.js, npm, Git, and Godspeed using winget...

REM Check for Node.js installation
where node >nul 2>nul
REM Check if winget is available
where winget >nul 2>nul
IF ERRORLEVEL 1 (
echo Node.js is not installed. Installing Node.js...
powershell -Command "Invoke-WebRequest -Uri 'https://nodejs.org/dist/v18.20.4/node-v18.20.4-x64.msi' -OutFile 'nodejs.msi'"
start /wait msiexec.exe /i nodejs.msi /quiet
del nodejs.msi
echo Error: winget is not available. Please ensure you have Windows Package Manager installed.
goto :end
)

REM Install Node.js (includes npm)
echo Installing Node.js...
winget install -e --id OpenJS.NodeJS
IF ERRORLEVEL 1 (
echo Error: Node.js installation failed. Please check manually.
goto :end
) ELSE (
echo Node.js is already installed.
echo Node.js installation successful.
)

REM Check for Git installation
where git >nul 2>nul
REM Install Git
echo Installing Git...
winget install -e --id Git.Git
IF ERRORLEVEL 1 (
echo Git is not installed. Installing Git...
powershell -Command "Invoke-WebRequest -Uri 'https://github.com/git-for-windows/git/releases/download/v2.42.0.windows.1/Git-2.42.0-64-bit.exe' -OutFile 'git-installer.exe'"
start /wait git-installer.exe /SILENT
del git-installer.exe
echo Error: Git installation failed. Please check manually.
goto :end
) ELSE (
echo Git is already installed.
echo Git installation successful.
)

REM Install Godspeed
echo Installing Godspeed globally using npm...
REM Install Godspeed globally using npm
echo Installing Godspeed...
npm install -g @godspeedsystems/godspeed
IF ERRORLEVEL 1 (
echo Error: Failed to install Godspeed. Please check your Node.js and npm setup.
) ELSE (
echo Godspeed installation complete.
)

REM Version Checks
echo Checking installed versions...
echo -------------------------------------

REM Check Node.js version
echo Node.js version:
node -v
IF ERRORLEVEL 1 (
echo Error: Node.js is not recognized.
) ELSE (
echo Node.js is correctly installed.
)

REM Check npm version
echo npm version:
npm -v
IF ERRORLEVEL 1 (
echo Error: npm is not recognized.
) ELSE (
echo npm is correctly installed.
)

REM Check Git version
echo Git version:
git --version
IF ERRORLEVEL 1 (
echo Error: Git is not recognized.
) ELSE (
echo Git is correctly installed.
)

REM Check Godspeed version
echo Godspeed version:
godspeed --version
IF ERRORLEVEL 1 (
echo Error: Godspeed is not recognized.
) ELSE (
echo Godspeed is correctly installed.
)

echo -------------------------------------
echo Setup complete.
echo Restarting terminal to apply changes...
timeout /t 3 >nul
start "" %COMSPEC%
exit
ENDLOCAL
pause
Loading