Skip to content
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
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# ArunaCore Changelog

## v1.0.0-BETA.5

- [FIX] Wrong management of `coreKey`
- Fixed an issue where the `coreKey` was handled incorrectly, causing it to be always null, resulting in clients being unable to access restricted resources.

- [FEAT] Split `401 Unauthorized` into `401 Unauthorized` and `403 Forbidden`
- Now, `401` is used when authentication fails (e.g., invalid secure key), while `403` is used when access is denied despite valid authentication (e.g., insufficient permissions, invalid key for specific target communication, invalid masterkey, etc.).
- This provides clearer feedback to clients about the nature of access issues.

- [FEAT] Implemented `client.request()` method in `WebSocketClient`
- This method allows sending a message and awaiting a response, simplifying request-response interactions.
- To use it, simply call `client.request(message)` and await the returned promise.
- To respond to such request on the other side, handle the `request` event and reply using `message.reply`.

- [CHORE] Improved code documentation and comments for better clarity and maintainability.

## v1.0.0-BETA.4

- [BREAKING] Dropped support for all versions below Node.js v20.11.1
Expand Down
4 changes: 2 additions & 2 deletions api/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "arunacore-api",
"version": "1.0.0-BETA.4",
"version": "1.0.0-BETA.5",
"description": "ArunaCore is an open source websocket server made with nodejs for intercomunication between applications.",
"main": "build/src/index.js",
"types": "build/src/index.d.ts",
Expand Down
5 changes: 3 additions & 2 deletions api/src/interfaces/IMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ export interface IMessage {
id: string,
key?: string
},
coreKey?: string,
uuid?: string,
command?: string,
args?: string[],
content: any
content: unknown
reply?: (content: unknown, options?: { args?: string[], toKey?: string }) => Promise<void>;
}
21 changes: 14 additions & 7 deletions api/src/interfaces/IWebsocketOptions.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import { Logger } from '@promisepending/logger.js';

export interface IReconnectionOptions {
enabled: boolean,
maxAttempts?: number,
delay?: number
}

export interface IWebsocketOptions {
host: string
port: number
id: string
secureMode?: boolean
secureKey?: string
shardMode?: boolean
logger?: Logger
host: string
port: number
id: string
secureMode?: boolean
secureKey?: string
shardMode?: boolean
logger?: Logger
reconnection?: IReconnectionOptions
}
Loading