how to write data via rest-api at port 3000

未关闭
#425 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
文档
描述清晰度
需要澄清
活跃度
停滞
技术栈
javascript

调研方向

从 rest-api-service-confg.json 和 issue 中描述的 POST /api/software 请求开始,然后检查 REST API 身份验证和服务角色的文档或入口点。当受支持的写入身份验证路径和所需的服务角色得到明确记录,并且报告的 401 场景得到处理后,即视为完成。

由索引模型根据 Issue 内容生成。

描述

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

主要语言
JavaScript
星标
56
派生
18
平均合并
19 小时 39 分钟
30 天内合并 PR
7

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

mitre-attack/attack-workbench-rest-api 的其他 Issue

查看 mitre-attack/attack-workbench-rest-api 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。