पर उपसर्ग जोड़ें क्या सभी एक्ट्यूएटर एंडपॉइंट्स में उपसर्ग जोड़ने का कोई आसान तरीका है?सभी स्प्रिंग बूट एक्ट्यूएटर एंडपॉइंट्स
/env -> /secure/env
/health -> /secure/health
/info -> /secure/info
...
पर उपसर्ग जोड़ें क्या सभी एक्ट्यूएटर एंडपॉइंट्स में उपसर्ग जोड़ने का कोई आसान तरीका है?सभी स्प्रिंग बूट एक्ट्यूएटर एंडपॉइंट्स
/env -> /secure/env
/health -> /secure/health
/info -> /secure/info
...
जेस्पर का जवाब पूरी तरह से सही है, लेकिन मैं सभी अंतिमबिंदुओं लगाकर की एक और अधिक सरल तरीके के लिए देख रहा था, और यह, उदा .:
management:
context-path: /secure
-> /secure/env
-> /secure/health
...
management.context-path
साथ किया जा सकता
अपने application.properties
में गुण endpoints.{name}.path
सेट करें। उदाहरण के लिए:
endpoints.actuator.path=/secure/actuator
endpoints.env.path=/secure/env
endpoints.health.path=/secure/health
endpoints.info.path=/secure/info
कि समाप्ति बिंदु पर सुरक्षा को सक्षम करने के true
को endpoints.{name}.sensitive
निर्धारित किया है। उदाहरण के लिए:
endpoints.health.sensitive=true
भी देखें Securing sensitive endpoints, Actuator Security और स्प्रिंग बूट संदर्भ दस्तावेज में HTTP health endpoint access restrictions आप अपने आवेदन के प्रवर्तक अंतिम बिंदुओं को सुरक्षित करना चाहते हैं।
application.properties
में सेट की गई सामान्य संपत्तियों की एक सूची के लिए स्प्रिंग बूट संदर्भ प्रलेखन में Common application properties देखें।