Skip to content

Commit 33c787f

Browse files
committed
[DAPS-1513] Address pr comments
1 parent d8c924c commit 33c787f

File tree

3 files changed

+11
-237
lines changed

3 files changed

+11
-237
lines changed

core/database/foxx/api/repository/example.js

Lines changed: 0 additions & 231 deletions
This file was deleted.

core/database/foxx/api/repository/factory.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,27 @@ const g_lib = require("../support");
3030
* @param {string[]} config.admins - Array of admin user IDs
3131
* @param {string} [config.endpoint] - Globus endpoint (required for GLOBUS type)
3232
* @param {string} [config.path] - File path (required for GLOBUS type)
33-
* @param {string} [config.pub_key] - Public SSH key (required for GLOBUS type)
33+
* @param {string} [config.pub_key] - Public key for ZeroMQ CURVE authentication (required for GLOBUS type)
3434
* @param {string} [config.address] - Network address (required for GLOBUS type)
3535
* @param {string} [config.exp_path] - Export path (optional for GLOBUS type)
3636
* @param {string} [config.domain] - Domain name (required for GLOBUS type)
3737
* @returns {{ok: boolean, error: *}|{ok: boolean, value: *}} Result object containing repository or error
3838
* @see https://doc.rust-lang.org/book/ch06-02-match.html
3939
*/
4040
const createRepositoryByType = (config) => {
41-
// Validate common fields
42-
if (!config.id || !config.type || !config.title || !config.capacity || !config.admins) {
41+
const missingFields = [];
42+
if (!config.id) missingFields.push("id");
43+
if (!config.type) missingFields.push("type");
44+
if (!config.title) missingFields.push("title");
45+
if (!config.capacity) missingFields.push("capacity");
46+
if (!config.admins) missingFields.push("admins");
47+
48+
if (missingFields.length > 0) {
4349
return Result.err({
4450
code: g_lib.ERR_INVALID_PARAM,
45-
message: "Missing required repository fields",
51+
message: `Missing required repository fields: ${missingFields.join(", ")}`,
4652
});
4753
}
48-
4954
/**
5055
* Type-based creation using switch (Rust match pattern)
5156
* Each case is like a match arm in Rust, handling a specific variant

core/database/foxx/api/repository/types.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const createRepositoryData = ({
6868
* @param {object} config - Globus configuration object
6969
* @param {string} config.endpoint - Globus endpoint identifier
7070
* @param {string} config.path - Repository path on filesystem
71-
* @param {string} config.pub_key - Public SSH key for authentication
71+
* @param {string} config.pub_key - Public key for ZeroMQ CURVE authentication
7272
* @param {string} config.address - Network address
7373
* @param {string} [config.exp_path] - Export path
7474
* @param {string} config.domain - Domain name

0 commit comments

Comments
 (0)