(c *gin.Context)
| 811 | } |
| 812 | |
| 813 | func (s *Server) pluginManagementNoRoute(c *gin.Context) { |
| 814 | if s == nil || c == nil || c.Request == nil || c.Request.URL == nil { |
| 815 | if c != nil { |
| 816 | c.AbortWithStatus(http.StatusNotFound) |
| 817 | } |
| 818 | return |
| 819 | } |
| 820 | path := c.Request.URL.Path |
| 821 | if strings.HasPrefix(path, "/v0/resource/plugins/") { |
| 822 | s.pluginResourceNoRoute(c) |
| 823 | return |
| 824 | } |
| 825 | if path != "/v0/management" && !strings.HasPrefix(path, "/v0/management/") { |
| 826 | c.AbortWithStatus(http.StatusNotFound) |
| 827 | return |
| 828 | } |
| 829 | if s.pluginHost == nil || s.mgmt == nil { |
| 830 | c.AbortWithStatus(http.StatusNotFound) |
| 831 | return |
| 832 | } |
| 833 | if !s.managementAvailable(c) { |
| 834 | return |
| 835 | } |
| 836 | s.mgmt.Middleware()(c) |
| 837 | if c.IsAborted() { |
| 838 | return |
| 839 | } |
| 840 | if s.mgmt.ServePluginAuthURL(c) { |
| 841 | c.Abort() |
| 842 | return |
| 843 | } |
| 844 | if s.pluginHost.ServeManagementHTTP(c.Writer, c.Request) { |
| 845 | c.Abort() |
| 846 | return |
| 847 | } |
| 848 | c.AbortWithStatus(http.StatusNotFound) |
| 849 | } |
| 850 | |
| 851 | func (s *Server) pluginResourceNoRoute(c *gin.Context) { |
| 852 | if s == nil || c == nil || c.Request == nil || c.Request.URL == nil { |
nothing calls this directly
no test coverage detected