Skip to content

Comments

v0.0.4#4

Open
roncodes wants to merge 12 commits intomainfrom
dev-v0.0.4
Open

v0.0.4#4
roncodes wants to merge 12 commits intomainfrom
dev-v0.0.4

Conversation

@roncodes
Copy link
Member

No description provided.

Manus AI and others added 12 commits February 15, 2026 08:39
- Add 'flb register' command for creating Registry Developer Accounts
- Interactive prompts for username, email, password, and name
- Input validation for username format and password length
- Calls /~registry/v1/developer-account/register API endpoint
- Provides clear success/error messages
- Guides users to login after successful registration
…nt-registration

feat: Add Registry Developer Account Registration
This commit adds the install-fleetbase command functionality on top of
the dev-v0.0.4 branch which includes the register command.

Both commands now coexist:
- register: Register a new Registry Developer Account
- install-fleetbase: Install Fleetbase using Docker

The install command includes:
- Interactive prompts for host, environment, and directory
- Automatic APP_KEY generation
- Docker compose configuration
- Console environment file updates
- Deployment automation
…d-rebased

Feature/install fleetbase command rebased
The install-fleetbase command now automatically clones the Fleetbase
repository into the target directory if docker-compose.yml is not found.

This improves the user experience by eliminating the need to manually
clone the repository before running the install command.

Changes:
- Automatically detects if Fleetbase files are missing
- Clones repository using 'git clone' if needed
- Creates target directory if it doesn't exist
- Provides clear feedback during the cloning process
- Gracefully handles clone failures with helpful error messages
…d-rebased

Feature/install fleetbase command rebased
The register command now accepts a --host parameter to allow users
to register against self-hosted Fleetbase instances instead of only
the default api.fleetbase.io.

Usage:
  flb register --host myinstance.com
  flb register -h myinstance.com

Changes:
- Added --host/-h option to register command
- Defaults to api.fleetbase.io if not specified
- Dynamically builds registration API URL based on host
- Updates login suggestion to include --host if used during registration
The --host parameter now accepts full URLs with protocol (http:// or https://)
instead of hardcoding https. This allows users to register against local
development instances using http://localhost:8000.

Changes:
- Accept full URL: https://api.fleetbase.io or http://localhost:8000
- Auto-add https:// if protocol is missing (backward compatible)
- Updated option description to clarify full URL format

Examples:
  flb register --host https://api.fleetbase.io
  flb register --host http://localhost:8000
  flb register --host myinstance.com (defaults to https://)
Fixed TypeError when API returns error messages as strings instead of arrays.
The error handling now properly handles both formats:
- Array: ['error message 1', 'error message 2']
- String: 'error message'

This prevents crashes when displaying validation errors from the API.
Added debug logging to help diagnose network request issues:
- Log the constructed API endpoint URL
- Log the request data being sent
- Log detailed error information including error codes
- Log when no response is received from server

This will help identify if:
- The URL is being constructed correctly
- The request is actually being made
- There are network connectivity issues
- The server is responding

console.log('\nRegistering account...');
console.log(`API Endpoint: ${registrationApi}`);
console.log(`Request Data:`, JSON.stringify(registrationData, null, 2));

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This logs sensitive data returned by
an access to password
as clear text.

Copilot Autofix

AI about 7 hours ago

In general, to fix clear‑text logging of sensitive information, you should either (1) avoid logging the sensitive fields entirely, or (2) mask/redact them before logging. For passwords, the best practice is to never log them, even in masked form if avoidable.

Here, the minimal, behavior‑preserving fix is to keep the helpful logging of request parameters but omit or redact the password field when printing. We can do this by creating a shallow copy of registrationData specifically for logging, removing or masking the password property, and then passing that safe object to JSON.stringify. This keeps the registration logic and API call unchanged; only the logging statement is updated.

Concretely, in index.js around line 790–792, we will replace:

console.log('\nRegistering account...');
console.log(`API Endpoint: ${registrationApi}`);
console.log(`Request Data:`, JSON.stringify(registrationData, null, 2));

with code that constructs a registrationDataForLog object (using object spread) and sets password to a placeholder (or deletes it) before logging. No new imports are needed; we can use plain JavaScript. The rest of the file remains as is.

Suggested changeset 1
index.js

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/index.js b/index.js
--- a/index.js
+++ b/index.js
@@ -789,7 +789,8 @@
 
         console.log('\nRegistering account...');
         console.log(`API Endpoint: ${registrationApi}`);
-        console.log(`Request Data:`, JSON.stringify(registrationData, null, 2));
+        const registrationDataForLog = { ...registrationData, password: '[REDACTED]' };
+        console.log(`Request Data:`, JSON.stringify(registrationDataForLog, null, 2));
 
         // Make API call to register
         const response = await axios.post(registrationApi, registrationData);
EOF
@@ -789,7 +789,8 @@

console.log('\nRegistering account...');
console.log(`API Endpoint: ${registrationApi}`);
console.log(`Request Data:`, JSON.stringify(registrationData, null, 2));
const registrationDataForLog = { ...registrationData, password: '[REDACTED]' };
console.log(`Request Data:`, JSON.stringify(registrationDataForLog, null, 2));

// Make API call to register
const response = await axios.post(registrationApi, registrationData);
Copilot is powered by AI and may make mistakes. Always verify output.
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.

1 participant