Skip to Content
Dapr学习手册
book

Dapr学习手册

by Haishi Bai, Yaron Schneider
November 2021
Beginner to intermediate
239 pages
4h 15m
Chinese
China Electric Power Press Ltd.
Content preview from Dapr学习手册
安全
149
GetSecretRequest
结构体包含一个键,以及作为元数据附加到请求的键值对
的集合。
type GetSecretRequest struct {
Name string `json:"name"`
Metadata map[string]string `json:"metadata"`
}
Dapr
不会以任何方式解析元数据。相反,它只是将所有附加的元数据传递给
密钥存储实现。这种设计是为了处理这样的情况:密钥存储如果需要密钥名
称之外的更多的信息来访问加密信息。请求这样的元数据会使使用安全存储
的代码的可移植性降低。虽然其他存储可以选择忽略元数据并照常运行,但
相同的元数据键可能会被多个密钥存储意外地选择,并且会被不同的存储进
行不同的解释,从而导致不可预知的错误。强烈建议你在
Init
方法中获取足
够的信息,这样密钥就可以只通过密钥名称来检索。
GetSecretResponse
结构包含密钥数据的键
/
值对:
type GetSecretResponse struct {
Data map[string]string `json:"data"`
}
如果找不到所请求的对象,则应返回错误代码。
如前所述,当你定义任何
Dapr
清单时,你可以使用
secret KeyRef
元素来引
用密钥。
Dapr
还引入了
secret API
,允许应用程序通过代码访问密钥。我们
将在下一节介绍这个
API
4.2.3 Secret API
Dapr
暴露
secret API ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

流畅的Python(第2版)

流畅的Python(第2版)

Luciano Ramalho
数据科学原理

数据科学原理

Posts & Telecom Press, Sinan Ozdemir
Python预测分析实战

Python预测分析实战

Posts & Telecom Press, Alvaro Fuentes
机器学习开发者指南

机器学习开发者指南

Posts & Telecom Press, Rodolfo Bonnin

Publisher Resources

ISBN: 9787519859367