🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@prsm/arc-server

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prsm/arc-server - npm Package Compare versions

Comparing version
1.3.7
to
1.3.8
+1
-1
package.json
{
"name": "@prsm/arc-server",
"version": "1.3.7",
"version": "1.3.8",
"description": "",

@@ -5,0 +5,0 @@ "author": "nvms",

# aider chat started at 2025-06-06 10:31:22
> You can skip this check with --no-gitignore
> Add .aider* to .gitignore (recommended)? (Y)es/(N)o [Yes]: n
> /Users/jonathanpyers/.local/bin/aider --watch-files --no-auto-commit
> Aider v0.84.0
> Main model: claude-sonnet-4-20250514 with diff edit format, infinite output
> Weak model: gemini/gemini-2.5-flash-preview-04-17
> Git repo: .git with 15 files
> Repo-map: using 4096 tokens, auto refresh
> Added ../../../../conventions/comments.md to the chat (read-only).
> Added ../../../../conventions/functional.md to the chat (read-only).
#### /add *
> Added .eslintrc.json to the chat
> Added .gitignore to the chat
> Added .npmignore to the chat
> Added README.md to the chat
> Added dist/index.cjs to the chat
> Added dist/index.d.ts to the chat
> Added dist/index.js to the chat
> Added package.json to the chat
> Added pnpm-lock.yaml to the chat
> Warning: it's best to only add files that need changes to the chat.
> https://aider.chat/docs/troubleshooting/edit-errors.html
> Added src/auth.ts to the chat
> Added src/hasher.ts to the chat
> Added src/index.ts to the chat
> Added src/jwt.ts to the chat
> Added src/server.ts to the chat
> Added tsconfig.json to the chat
#### /drop lock
> Removed pnpm-lock.yaml from the chat
#### /drop dist
> Removed dist/index.cjs from the chat
> Removed dist/index.js from the chat
> Removed dist/index.d.ts from the chat
#### /drop tsocnfig
#### /drop .eslintrc
> Removed .eslintrc.json from the chat
#### /drop .npmig
> Removed .npmignore from the chat
#### /drop .gitig
> Removed .gitignore from the chat
#### /tokens
> Approximate context window usage for claude-sonnet-4-20250514, in tokens:
> $ 0.0063 2,112 system messages
> $ 0.0023 760 repository map use --map-tokens to resize
> $ 0.0001 30 src/index.ts /drop to remove
> $ 0.0004 119 ../../../../conventions/comments.md (read-only) /drop to remove
> $ 0.0004 130 tsconfig.json /drop to remove
> $ 0.0006 202 src/auth.ts /drop to remove
> $ 0.0008 281 ../../../../conventions/functional.md (read-only) /drop to remove
> $ 0.0011 378 src/hasher.ts /drop to remove
> $ 0.0012 416 package.json /drop to remove
> $ 0.0019 638 README.md /drop to remove
> $ 0.0059 1,973 src/jwt.ts /drop to remove
> $ 0.0068 2,262 src/server.ts /drop to remove
> ==================
> $ 0.0279 9,301 tokens total
> 190,699 tokens remaining in context window
> 200,000 tokens max context window size
#### /drop package
> Removed src/server.ts from the chat
> Removed tsconfig.json from the chat
> Removed src/auth.ts from the chat
> Removed README.md from the chat
> Removed package.json from the chat
> Removed src/index.ts from the chat
> Removed src/jwt.ts from the chat
> Removed src/hasher.ts from the chat
#### /ask how can I define additional users in this server? i know it by default creates a root user, but how do I define other users? this is my package from a long time ago, and I can't remember what I did. answer BRIEFLY PLEASE
#### how can I define additional users in this server? i know it by default creates a root user, but how do I define other users? this is my package from a long time ago, and I can't remember what I did. answer BRIEFLY PLEASE
Looking at the code, you can create additional users by calling the private `createUser` method. However, since it's private, you'd need to either:
1. Make it public and call `ArcServer.createUser(username, password)`
2. Or expose it through the command server interface that handles authentication
The server already has the logic to create users - it just needs to be accessible. You'd typically expose this through an admin endpoint or make the method public.
> Tokens: 4.7k sent, 101 received. Cost: $0.02 message, $0.02 session.
#### /ask okay I think we should make it public, but i have another question first. is there a way to prevent the default root user from being created? or at least change the password?
#### okay I think we should make it public, but i have another question first. is there a way to prevent the default root user from being created? or at least change the password?
Looking at the `ensureRootUserExists` method, there's no built-in way to prevent the root user creation or change its password. The method hardcodes both the username "root" and password "root".
You could modify the `ArcServerOptions` type to include optional `rootUser` settings like:
```typescript
type ArcServerOptions = {
// existing options...
rootUser?: {
username?: string;
password?: string;
disabled?: boolean;
};
};
```
Then update `ensureRootUserExists` to use these options or skip creation entirely if `disabled: true`.
> Tokens: 4.9k sent, 133 received. Cost: $0.02 message, $0.03 session.
#### please make these changes, including making createUser public, then update the README to showcase these things
I need to edit the following files to make these changes:
1. **src/server.ts** - to add rootUser options to ArcServerOptions type, make createUser public, and update ensureRootUserExists method
2. **README.md** - to document the new user management features
Please add these files to the chat so I can make the necessary changes.
> Tokens: 7.6k sent, 80 received. Cost: $0.02 message, $0.06 session.
> README.md
> Add file to the chat? (Y)es/(N)o/(A)ll/(S)kip all/(D)on't ask again [Yes]: y
> src/server.ts
> Add file to the chat? (Y)es/(N)o/(A)ll/(S)kip all/(D)on't ask again [Yes]: y
I'll make the changes to add rootUser options, make createUser public, and update the README.
src/server.ts
````typescript
<<<<<<< SEARCH
export type ArcServerOptions = {
host: string;
port: number;
secure: boolean;
shardedCollections?: ShardedCollectionDefinition<unknown>[];
};
=======
export type ArcServerOptions = {
host: string;
port: number;
secure: boolean;
shardedCollections?: ShardedCollectionDefinition<unknown>[];
rootUser?: {
username?: string;
password?: string;
disabled?: boolean;
};
};
>>>>>>> REPLACE
````
src/server.ts
````typescript
<<<<<<< SEARCH
static async init({ host = "localhost", port = 3351, secure = false, shardedCollections = [] }: ArcServerOptions) {
this.emitter = new EventEmitter();
this.queryHandler = new QueryHandler(shardedCollections);
this.initializeCollections();
this.ensureRootUserExists();
await this.createServer(host, port, secure);
}
=======
static async init({ host = "localhost", port = 3351, secure = false, shardedCollections = [], rootUser }: ArcServerOptions) {
this.emitter = new EventEmitter();
this.queryHandler = new QueryHandler(shardedCollections);
this.initializeCollections();
this.ensureRootUserExists(rootUser);
await this.createServer(host, port, secure);
}
>>>>>>> REPLACE
````
src/server.ts
````typescript
<<<<<<< SEARCH
private static ensureRootUserExists() {
const rootUser = this.auth.users.find({ username: "root" });
if (!rootUser.length) {
this.auth.users.insert({
username: "root",
password: hash.encode("root"),
});
}
}
=======
private static ensureRootUserExists(rootUserOptions?: { username?: string; password?: string; disabled?: boolean }) {
if (rootUserOptions?.disabled) {
return;
}
const username = rootUserOptions?.username || "root";
const password = rootUserOptions?.password || "root";
const existingUser = this.auth.users.find({ username });
if (!existingUser.length) {
this.auth.users.insert({
username,
password: hash.encode(password),
});
}
}
>>>>>>> REPLACE
````
src/server.ts
````typescript
<<<<<<< SEARCH
private static createUser(username: string, password: string) {
=======
static createUser(username: string, password: string) {
>>>>>>> REPLACE
````
src/server.ts
````typescript
<<<<<<< SEARCH
private static removeUser(username: string) {
=======
static removeUser(username: string) {
>>>>>>> REPLACE
````
README.md
````markdown
<<<<<<< SEARCH
## Quickstart
```typescript
import { ArcServer } from "@prsm/arc-server";
ArcServer.init({ host: "0.0.0.0", port: 3351, secure: false });
```
=======
## Quickstart
```typescript
import { ArcServer } from "@prsm/arc-server";
ArcServer.init({ host: "0.0.0.0", port: 3351, secure: false });
```
## User Management
### Root User Configuration
By default, the server creates a root user with username "root" and password "root". You can customize this:
```typescript
// Custom root user credentials
ArcServer.init({
host: "0.0.0.0",
port: 3351,
secure: false,
rootUser: {
username: "admin",
password: "secure-password"
}
});
// Disable root user creation entirely
ArcServer.init({
host: "0.0.0.0",
port: 3351,
secure: false,
rootUser: {
disabled: true
}
});
```
### Creating Additional Users
You can create additional users programmatically:
```typescript
// Create a new user
ArcServer.createUser("username", "password");
// Remove a user
ArcServer.removeUser("username");
```
>>>>>>> REPLACE
````
> Tokens: 9.1k sent, 996 received. Cost: $0.04 message, $0.10 session.
> Applied edit to README.md
> Applied edit to src/server.ts
#### /commit
> Commit 76b538f feat: Implement user management and root user config
> You can use /undo to undo and discard each aider commit.
#### /commit
> Commit 19a8f1a style: Improve code formatting and readability
> You can use /undo to undo and discard each aider commit.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet