当前位置:网站首页>Istio practical skills: implement header based authorization
Istio practical skills: implement header based authorization
2022-06-24 12:32:00 【imroc】
This article excerpts from istio Learning notes
background
Some business scenarios are http header or grpc metadata There will be user information in , Want to be in mesh This layer authorizes requests based on user information , If the conditions are not met, the interface will not return the corresponding data .
Solution
Istio Of AuthorizationPolicy Based on is not supported Header Authorization of , But you can use VirtualService To achieve , matching http header ( Include grpc metadata), Then add a default route , Fixed fault injection used returns 401, Example :
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: helloworld-server
spec:
hosts:
- helloworld-server
http:
- name: whitelist
match:
- headers:
end-user:
regex: "roc"
route:
- destination:
host: helloworld-server
port:
number: 9000
- name: default
route:
- destination:
host: helloworld-server
port:
number: 9000
fault:
abort:
percentage:
value: 100
httpStatus: 401边栏推荐
- 11+文章-机器学习打造ProTICS框架-深度揭示了不同分子亚型中肿瘤浸润免疫细胞对预后的影响
- [cloud based co creation] interpretation of harmonyos application and service ecology
- The solution of distributed system: directory, message queue, transaction system and others
- How can I open an account with new bonds? Is it safe
- "Meng Hua Lu" is about to have a grand finale. It's better to learn it first than to look ahead!
- 我真傻,招了一堆只会“谷歌”的程序员!
- 计组-总复习
- AXI低功耗接口
- Cluster control management
- What are the low threshold financial products in 2022? Not much money
猜你喜欢

GLOG from getting started to getting started

AXI低功耗接口

ArrayList # sublist these four holes, you get caught accidentally

Linker --- linker

Opencv learning notes - regions of interest (ROI) and image blending

Basic path test of software test on the function of the previous day

Ten thousand campus developers play AI in a fancy way. It's enough to see this picture!

链接器 --- Linker

GLOG从入门到入门

How can a shell script (.Sh file) not automatically close or flash back after execution?
随机推荐
Istio FAQ: istio init crash
pipeline groovy
GTEST from getting started to getting started
How to write controller layer code gracefully?
How does easygbs, a national standard platform, solve the problem that information cannot be carried across domains?
Group planning - General Review
Embedded must learn! Detailed explanation of hardware resource interface - based on arm am335x development board (Part 2)
As one of the bat, what open source projects does Tencent have?
How to open a new bond? Is it safe to open an account
Collation of related papers on root cause analysis
Examples of AES and RSA encryption operations implemented by php7.1
【Go语言刷题篇】Go从0到入门4:切片的高级用法、初级复习与Map入门学习
A flaw in R markdown: folders cannot have Chinese
How can I open an account with new bonds? Is it safe
炒伦敦金短线稳定赚钱技巧?在哪里炒伦敦金安全靠谱?
如何优雅的写 Controller 层代码?
Detailed explanation of the execution order of the expression and loop body in the for loop
深度学习~11+高分疾病相关miRNA研究新视角
Use the object selection tool to quickly create a selection in Adobe Photoshop
How stupid of me to hire a bunch of programmers who can only "Google"!