从Unauthorized 401错误学习Spring Boot的Actuator

 

以前用Spring Boot都是别人搭好的框架,而后本身在里面写就好了。对原理、细节上都怎么涉及,毕竟需求都作不完。可是昨天一个访问RESTful接口的401问题搞了我2个小时。网上找的不少用:安全

1 managements.security.enabled=false

而且添加一个actxxx包的方法对我也无论用,由于项目里面已经配置了这个。可是我仍是遇到了401的这个问题。不死心继续搜,而后加入了这个配置就行了:app

1 security.ignored=/**

解决这个问题竟然花了我两个小时,仍是处处去找,不懂Spring Boot框架的原理,好比安全方面的,除了问题两眼一抹黑。框架

目标:弄清Spring Boot总体框架和框架中每一个小块的基本知识。ide

Features

  • Create stand-alone Spring applicationsui

  • Embed Tomcat, Jetty or Undertow directly (no need to deploy WAR files)spa

  • Provide opinionated 'starter' dependencies to simplify your build configurationcode

  • Automatically configure Spring and 3rd party libraries whenever possibleorm

  • Provide production-ready features such as metrics, health checks and externalized configurationblog

  • Absolutely no code generation and no requirement for XML configuration接口

 真的是打扰了,内容好像挺多的。

 

 第四部分:Spring Boot Actuator: 为生产环境准备的特性

Actuator: 执行器,驱动器。当你把应用发布到生产环境的时候,Spring Boot提供了一些额外的特性来帮助你监控和管理应用。你经过选择HTTP endpoints或者JMX来管理和监控你的应用。

审计,健康和度量收集能够自动地加入到应用中。

 

V. Spring Boot Actuator: Production-ready features49. Enabling Production-ready Features50. Endpoints50.1. Enabling Endpoints50.2. Exposing Endpoints50.3. Securing HTTP Endpoints50.4. Configuring Endpoints50.5. Hypermedia for Actuator Web Endpoints50.6. Actuator Web Endpoint Paths50.7. CORS Support50.8. Implementing Custom Endpoints50.8.1. Receiving InputInput type conversion50.8.2. Custom Web EndpointsWeb Endpoint Request PredicatesPathHTTP methodConsumesProducesWeb Endpoint Response StatusWeb Endpoint Range RequestsWeb Endpoint Security50.8.3. Servlet endpoints50.8.4. Controller endpoints50.9. Health Information50.9.1. Auto-configured HealthIndicators50.9.2. Writing Custom HealthIndicators50.9.3. Reactive Health Indicators50.9.4. Auto-configured ReactiveHealthIndicators50.10. Application Information50.10.1. Auto-configured InfoContributors50.10.2. Custom Application Information50.10.3. Git Commit Information50.10.4. Build Information50.10.5. Writing Custom InfoContributors51. Monitoring and Management over HTTP51.1. Customizing the Management Endpoint Paths51.2. Customizing the Management Server Port51.3. Configuring Management-specific SSL51.4. Customizing the Management Server Address51.5. Disabling HTTP Endpoints52. Monitoring and Management over JMX52.1. Customizing MBean Names52.2. Disabling JMX Endpoints52.3. Using Jolokia for JMX over HTTP52.3.1. Customizing Jolokia52.3.2. Disabling Jolokia53. Loggers53.1. Configure a Logger54. Metrics54.1. Getting started54.2. Supported monitoring systems54.2.1. Atlas54.2.2. Datadog54.2.3. Ganglia54.2.4. Graphite54.2.5. Influx54.2.6. JMX54.2.7. New Relic54.2.8. Prometheus54.2.9. SignalFx54.2.10. Simple54.2.11. StatsD54.2.12. Wavefront54.3. Supported Metrics54.3.1. Spring MVC Metrics54.3.2. Spring WebFlux Metrics54.3.3. RestTemplate Metrics54.3.4. Cache Metrics54.3.5. DataSource Metrics54.3.6. RabbitMQ Metrics54.4. Registering custom metrics54.5. Customizing individual metrics54.5.1. Per-meter properties54.6. Metrics endpoint55. Auditing56. HTTP Tracing56.1. Custom HTTP tracing57. Process Monitoring57.1. Extending Configuration57.2. Programmatically58. Cloud Foundry Support58.1. Disabling Extended Cloud Foundry Actuator Support58.2. Cloud Foundry Self-signed Certificates58.3. Custom context path59. What to Read NextVI. Deploying Spring Boot Applications60. Deploying to the Cloud60.1. Cloud Foundry60.1.1. Binding to Services60.2. Heroku60.3. OpenShift60.4. Amazon Web Services (AWS)60.4.1. AWS Elastic BeanstalkUsing the Tomcat PlatformUsing the Java SE Platform60.4.2. Summary60.5. Boxfuse and Amazon Web Services60.6. Google Cloud61. Installing Spring Boot Applications61.1. Supported Operating Systems61.2. Unix/Linux Services61.2.1. Installation as an init.d Service (System V)Securing an init.d Service61.2.2. Installation as a systemd Service61.2.3. Customizing the Startup ScriptCustomizing the Start Script when It Is WrittenCustomizing a Script When It Runs61.3. Microsoft Windows Services62. What to Read Next

相关文章
相关标签/搜索