!https://github.com/ConsumerDataRight/mock-data-holder/blob/main/./Assets/cdr-logo.png?raw=true
模拟数据持有者的源代码、文档和使用说明。此仓库提供了数据持有者的模拟实现,旨在帮助社区开发和测试其CDR解决方案。模拟数据持有者解决方案可配置为银行或能源行业使用。
模拟数据持有者:
模拟数据持有者使用https://github.com/ConsumerDataRight/authorisation-server%E3%80%81https://github.com/ConsumerDataRight/mock-register%E5%92%8Chttps://github.com/ConsumerDataRight/mock-data-recipient%E3%80%82%E6%82%A8%E5%8F%AF%E4%BB%A5%E5%B0%86%E6%A8%A1%E6%8B%9F%E6%95%B0%E6%8D%AE%E6%8C%81%E6%9C%89%E8%80%85%E3%80%81%E6%A8%A1%E6%8B%9F%E6%B3%A8%E5%86%8C%E4%B8%AD%E5%BF%83%E5%92%8C%E6%A8%A1%E6%8B%9F%E6%95%B0%E6%8D%AE%E6%8E%A5%E6%94%B6%E8%80%85%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%E4%B8%AD%E7%9A%84%E4%BB%BB%E4%BD%95%E4%B8%80%E4%B8%AA%E6%9B%BF%E6%8D%A2%E4%B8%BA%E6%82%A8%E8%87%AA%E5%B7%B1%E7%9A%84%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%E3%80%82
本项目中的工件有多种使用方式:
要开始,请克隆源代码。
git clone https://github.com/ConsumerDataRight/mock-data-holder.git
从1.2.0版本开始,模拟数据持有者现在使用https://github.com/ConsumerDataRight/authorisation-server%E4%BD%9C%E4%B8%BA%E8%BA%AB%E4%BB%BD%E6%8F%90%E4%BE%9B%E5%95%86%E3%80%82%E8%BF%90%E8%A1%8C%E6%A8%A1%E6%8B%9F%E6%95%B0%E6%8D%AE%E6%8C%81%E6%9C%89%E8%80%85%E6%97%B6%EF%BC%8Chttps://github.com/ConsumerDataRight/authorisation-server%E4%B9%9F%E9%9C%80%E8%A6%81%E8%BF%90%E8%A1%8C%E3%80%82%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A8%E4%BB%A5%E4%B8%8B%E5%91%BD%E4%BB%A4%E5%85%8B%E9%9A%86https://github.com/ConsumerDataRight/authorisation-server%E4%BB%93%E5%BA%93%EF%BC%9A
git clone https://github.com/ConsumerDataRight/authorisation-server.git ./cdr-auth-server
有关设置行业配置文件、启动和调试解决方案的帮助,请参阅https://github.com/ConsumerDataRight/mock-data-holder/blob/main/./Help/debugging/HELP.md%E3%80%82
如果您想向模拟数据持有者仓库贡献功能或修复,请查阅https://github.com/ConsumerDataRight/mock-data-holder/blob/main/./CONTRIBUTING.md%E3%80%82
Docker镜像在https://hub.docker.com/r/consumerdataright%E4%B8%8A%E6%8F%90%E4%BE%9B%EF%BC%8C%E5%8C%85%E6%8B%AChttps://hub.docker.com/r/consumerdataright/mock-data-holder%E5%92%8Chttps://hub.docker.com/r/consumerdataright/mock-data-holder-energy%E6%A8%A1%E6%8B%9F%E6%95%B0%E6%8D%AE%E6%8C%81%E6%9C%89%E8%80%85%E3%80%82
注意:从1.2.0版本开始,身份服务器已替换为https://github.com/ConsumerDataRight/authorisation-server%E3%80%82%E5%B0%BD%E7%AE%A1https://github.com/ConsumerDataRight/authorisation-server%E4%BD%9C%E4%B8%BA%E5%8D%95%E7%8B%AC%E7%9A%84%E4%BB%93%E5%BA%93%E5%AD%98%E5%9C%A8%EF%BC%8C%E4%BD%86%E5%BD%93%E4%B8%BADocker%E6%9E%84%E5%BB%BAmock-data-holder%E9%93%B6%E8%A1%8C%E6%88%96%E8%83%BD%E6%BA%90%E9%95%9C%E5%83%8F%E6%97%B6%EF%BC%8C%E6%8E%88%E6%9D%83%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%BC%9A%E8%A2%AB%E5%A4%8D%E5%88%B6%E5%88%B0%E9%95%9C%E5%83%8F%E4%B8%AD%EF%BC%8C%E6%9B%BF%E6%8D%A2Identity Server 4。
从Docker拉取最新的银行或能源镜像
运行以下命令从Docker Hub拉取最新的银行模拟数据持有者镜像:
docker pull consumerdataright/mock-data-holder:latest
运行以下命令从Docker Hub拉取最新的能源模拟数据持有者镜像:
docker pull consumerdataright/mock-data-holder-energy:latest
有关将行业设置为银行或能源、将解决方案作为容器启动和调试以及替换您自己的解决方案的帮助,请参阅https://github.com/ConsumerDataRight/mock-data-holder/blob/main/./Help/container/HELP.md%E3%80%82
试用
可以通过访问以下地址查看模拟数据持有者的OpenID Connect发现文档:
银行模拟数据持有者 https://localhost:8001/.well-known/openid-configuration 能源模拟数据持有者 https://localhost:8101/.well-known/openid-configuration
https://github.com/ConsumerDataRight/mock-data-recipient%E5%B7%B2%E6%9E%84%E5%BB%BA%E4%B8%BA%E6%B5%8B%E8%AF%95%E5%B7%A5%E5%85%B7%EF%BC%8C%E7%94%A8%E4%BA%8E%E6%BC%94%E7%A4%BA%E6%B3%A8%E5%86%8C%E4%B8%AD%E5%BF%83%E5%92%8C%E6%A8%A1%E6%8B%9F%E6%95%B0%E6%8D%AE%E6%8C%81%E6%9C%89%E8%80%85%E4%B9%8B%E9%97%B4%E7%9A%84%E4%BA%A4%E4%BA%92%E3%80%82%E6%A8%A1%E6%8B%9F%E6%95%B0%E6%8D%AE%E6%8E%A5%E6%94%B6%E8%80%85%E5%8F%AF%E7%94%A8%E4%BA%8E%E6%89%A7%E8%A1%8C%E5%8A%A8%E6%80%81%E5%AE%A2%E6%88%B7%E7%AB%AF%E6%B3%A8%E5%86%8C%E3%80%81%E5%88%9B%E5%BB%BA%E5%90%8C%E6%84%8F%E5%AE%89%E6%8E%92%E5%92%8C%E6%8E%A2%E7%B4%A2%E6%A8%A1%E6%8B%9F%E6%95%B0%E6%8D%AE%E6%8C%81%E6%9C%89%E8%80%85API%E3%80%82%E6%8F%90%E4%BE%9B%E7%9A%84https://github.com/ConsumerDataRight/mock-data-holder/blob/main/./Help/container/HELP.md%E5%B0%86%E5%8D%8F%E5%8A%A9%E5%9C%A8Docker%E4%B8%AD%E8%AE%BE%E7%BD%AE%E6%A8%A1%E6%8B%9FCDR%E7%94%9F%E6%80%81%E7%B3%BB%E7%BB%9F%E3%80%82
证书管理
有关证书如何用于模拟数据持有者的更多信息,请查阅https://github.com/ConsumerDataRight/mock-data-holder/blob/main/./CertificateManagement/README.md%E6%96%87%E6%A1%A3%E3%80%82
加载您自己的银行或能源种子数据
当模拟数据持有者容器首次启动时,它将从CDR.DataHolder.Manage.API项目中包含的seed-data-{industry}.json文件加载数据。使用银行配置文件运行模拟数据持有者将从seed-data-banking.json文件加载数据;使用能源配置文件运行将从seed-data-energy.json文件加载数据。这些文件包含虚拟银行和能源数据(客户、账户、银行交易、能源优惠)以及可从注册中心获取的数据接收者元数据。当调用资源API时,将返回虚拟银行或能源数据。
有几种方法可以将您自己的数据加载到容器实例中:
seed-data.json文件/app/manage/Data文件夹中,复制seed-data-{industry}.json文件,重命名为您选择的名称,例如my-seed-data.json。/app/manage/appsettings.json文件以加载新的数据文件并覆盖现有数据:"SeedData": { "FilePath": "Data/my-seed-data.json", "OverwriteExistingData": true },
模拟数据持有者包含管理元数据API,允许将元数据重新加载到仓库中。
要使用元数据重新加载仓库,请向管理API发出以下请求:
注意:调用此API将删除所有现有元数据并重新加载提供的元数据
银行模拟数据持有者 POST https://localhost:8005/manage/metadata { <JSON元数据 - 与GET /manage/metadata响应或seed-data.json文件格式相同> }
能源模拟数据持有者 POST https://localhost:8105/manage/metadata { <JSON元数据 - 与GET /manage/metadata响应或seed-data.json文件格式相同> }
注意:目前管理API端点未应用任何身份验证/授权,因为这些被视为容器所有者可控。如果社区有相关反馈或提交拉取请求,可能会添加此功能。
https://github.com/ConsumerDataRight/mock-data-holder/blob/main/./Source/DockerCompose/docker-compose.yml%E5%8F%AF%E7%94%A8%E4%BA%8E%E8%BF%90%E8%A1%8C%E6%A8%A1%E6%8B%9FCDR%E7%94%9F%E6%80%81%E7%B3%BB%E7%BB%9F%E4%B8%AD%E7%9A%84%E5%A4%9A%E4%B8%AA%E5%AE%B9%E5%99%A8%E3%80%82
注意:https://github.com/ConsumerDataRight/mock-data-holder/blob/main/./Source/DockerCompose/docker-compose.yml%E4%BD%BF%E7%94%A8Docker Hub上的Microsoft SQL Server镜像。使用https://github.com/ConsumerDataRight/mock-data-holder/blob/main/./Source/DockerCompose/docker-compose.yml%E5%BF%85%E9%A1%BB%E6%8E%A5%E5%8F%97Microsoft SQL Server镜像的Microsoft EULA。有关更多信息,请参见Docker Hub上的Microsoft SQL Server镜像。
有关将解决方案作为容器启动和调试以及替换您自己的解决方案的帮助,请参阅https://github.com/ConsumerDataRight/mock-data-holder/blob/main/./Help/container/HELP.md%E3%80%82
根据https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.34.0/#introduction%EF%BC%8C%E6%95%B0%E6%8D%AE%E6%8C%81%E6%9C%89%E8%80%85%E5%9C%A8%E6%B6%88%E8%B4%B9%E8%80%85%E6%95%B0%E6%8D%AE%E6%9D%83%E5%88%A9%E4%B8%AD%E8%BF%90%E8%90%A5%E9%9C%80%E8%A6%81%E4%BB%A5%E4%B8%8B%E6%A0%B8%E5%BF%83%E5%8A%9F%E8%83%BD%EF%BC%9A
模拟数据持有者与https://github.com/ConsumerDataRight/authorisation-server%E7%BB%93%E5%90%88%EF%BC%8C%E4%B8%BA%E9%93%B6%E8%A1%8C%E5%92%8C%E8%83%BD%E6%BA%90%E8%A1%8C%E4%B8%9A%E6%8F%90%E4%BE%9B%E6%89%80%E6%9C%89%E8%BF%99%E4%BA%9B%E5%8A%9F%E8%83%BD%E3%80%82%E4%B8%8B%E5%9B%BE%E6%98%BE%E7%A4%BA%E4%BA%86%E5%9C%A8%E9%9B%86%E6%88%90%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83%E4%B8%AD%E6%89%93%E5%BC%80%E6%97%B6%E7%9A%84%E6%A8%A1%E6%8B%9F%E6%95%B0%E6%8D%AE%E6%8C%81%E6%9C%89%E8%80%85%E5%92%8C%E6%8E%88%E6%9D%83%E6%9C%8D%E5%8A%A1%E5%99%A8%E3%80%82
!https://github.com/ConsumerDataRight/mock-data-holder/blob/main/./Assets/mock-data-holder-components.PNG?raw=true
通过启动给定行业所需的项目并使用行业特定数据和端口,可以在银行和能源之间切换。下图显示了根据行业配置文件启动的项目,还说明了哪些数据持有者功能在行业间共享。
!https://github.com/ConsumerDataRight/mock-data-holder/blob/main/./Assets/mock-data-holder-banking-profile.PNG?raw=true !https://github.com/ConsumerDataRight/mock-data-holder/blob/main/./Assets/mock-data-holder-energy-profile.PNG?raw=true
以下部分概述了模拟数据持有者的高层架构和组件:
!https://github.com/ConsumerDataRight/mock-data-holder/blob/main/./Assets/mock-data-holder-banking-architecture.png?raw=true
模拟数据持有者包含以下组件:
https://localhost:8000Get Status和Get Outages端口8000访问https://localhost:8001https://localhost:8002Get Accounts和Get Transactions端点托管于https://localhost:8003Get Customer端点托管于https://localhost:8006https://localhost:8005!https://github.com/ConsumerDataRight/mock-data-holder/blob/main/./Assets/mock-data-holder-energy-architecture.png?raw=true
模拟数据持有者包含以下组件:
https://localhost:8100Get Status和Get Outages端口8100访问https://localhost:8101https://localhost:8102Get Accounts和Get Concessions端点托管于https://localhost:8103Get Customer端点托管于https://localhost:8106https://localhost:8105构建模拟数据持有者使用了以下技术:
C#编写,基于.Net 8框架Ocelot实现SQL实例xUnit是用于编写和运行测试的框架Microsoft Playwright是用于Web测试的框架本解决方案包含自动化集成测试。有关更多信息,请参见https://github.com/ConsumerDataRight/mock-data-holder/blob/main/./Help/testing/HELP.md%E6%96%87%E6%A1%A3%E3%80%82
我们鼓励社区贡献。请参见我们的[贡献指南](https://github.com/ConsumerDataRight/mock-data-holder/blob/main/./CONTRIBUTING.md
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务