Skip to content

how to write data via rest-api at port 3000 #425

Description

@szlf619

I am trying to add a new software via localhost:3000, with a problem "401 Unauthorized"

When I use name 'navigator' with read-only, I can get the software data. I tried three accounts and go through the config file within the project, there are only 3 service roles "read-only", "stix-export","collection-manager".

How can I do the post operation? or is there anyother serviceRole with write permission to support 'Post' ?

rest-api-service-confg.json is set as follows:
{
"serviceAuthn": {
"challengeApikey": {
"enable": true,
"serviceAccounts": [
{
"name": "collection-manager",
"apikey": "sample-key",
"serviceRole": "collection-manager"
}
]
},
"basicApikey": {
"enable": true,
"serviceAccounts": [
{
"name": "navigator",
"apikey": "sample-key-1",
"serviceRole": "read-only"
},
{
"name": "apikey-test-service",
"apikey": "sample-key-2",
"serviceRole": "stix-export"
},
{
"name": "collection-manager",
"apikey": "sample-key-2",
"serviceRole": "collection-manager"
}
]
}
}
}
log:
2025-09-19 11:22:16 2025-09-19T03:22:16.647Z [HTTP] GET /api/software 200 90.058 ms - -
2025-09-19 11:22:16 2025-09-19T03:22:16.699Z [HTTP] POST /api/software 401 16.854 ms - 14
2025-09-19 11:22:16 2025-09-19T03:22:16.707Z [HTTP] POST /api/software 401 3.321 ms - 14
2025-09-19 11:22:16 2025-09-19T03:22:16.713Z [HTTP] POST /api/software 401 1.281 ms - 14

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions