mirror of
				https://github.com/NginxProxyManager/nginx-proxy-manager.git
				synced 2025-11-04 01:15:14 +00:00 
			
		
		
		
	Certificates Renewal + SSE
- Certificate renewal is just a re-request as it's forced already - Rejig the routes for readability - Added Server Side Events so that the UI would invalidate the cache when changes happen on the backend, such as certs being provided or failing - Added a SSE Token, which has the same shelf life as normal token but can't be used interchangeably. The reason for this is, the SSE endpoint needs a token for auth as a Query param, so it would be stored in log files. If someone where to get a hold of that, it's pretty useless as it can't be used to change anything, only to listen for events until it expires - Added test endpoint for SSE testing only availabe in debug mode
This commit is contained in:
		@@ -1,21 +1,17 @@
 | 
			
		||||
{
 | 
			
		||||
	"operationId": "refreshToken",
 | 
			
		||||
	"summary": "Refresh your access token",
 | 
			
		||||
	"tags": [
 | 
			
		||||
		"Tokens"
 | 
			
		||||
	],
 | 
			
		||||
	"tags": ["Tokens"],
 | 
			
		||||
	"responses": {
 | 
			
		||||
		"200": {
 | 
			
		||||
			"description": "200 response",
 | 
			
		||||
			"content": {
 | 
			
		||||
				"application/json": {
 | 
			
		||||
					"schema": {
 | 
			
		||||
						"required": [
 | 
			
		||||
							"result"
 | 
			
		||||
						],
 | 
			
		||||
						"required": ["result"],
 | 
			
		||||
						"properties": {
 | 
			
		||||
							"result": {
 | 
			
		||||
								"$ref": "#/components/schemas/StreamObject"
 | 
			
		||||
								"$ref": "#/components/schemas/TokenObject"
 | 
			
		||||
							}
 | 
			
		||||
						}
 | 
			
		||||
					},
 | 
			
		||||
@@ -34,4 +30,4 @@
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,7 @@
 | 
			
		||||
{
 | 
			
		||||
	"operationId": "requestToken",
 | 
			
		||||
	"summary": "Request a new access token from credentials",
 | 
			
		||||
	"tags": [
 | 
			
		||||
		"Tokens"
 | 
			
		||||
	],
 | 
			
		||||
	"tags": ["Tokens"],
 | 
			
		||||
	"requestBody": {
 | 
			
		||||
		"description": "Credentials Payload",
 | 
			
		||||
		"required": true,
 | 
			
		||||
@@ -19,12 +17,10 @@
 | 
			
		||||
			"content": {
 | 
			
		||||
				"application/json": {
 | 
			
		||||
					"schema": {
 | 
			
		||||
						"required": [
 | 
			
		||||
							"result"
 | 
			
		||||
						],
 | 
			
		||||
						"required": ["result"],
 | 
			
		||||
						"properties": {
 | 
			
		||||
							"result": {
 | 
			
		||||
								"$ref": "#/components/schemas/StreamObject"
 | 
			
		||||
								"$ref": "#/components/schemas/TokenObject"
 | 
			
		||||
							}
 | 
			
		||||
						}
 | 
			
		||||
					},
 | 
			
		||||
@@ -49,9 +45,7 @@
 | 
			
		||||
					"schema": {
 | 
			
		||||
						"type": "object",
 | 
			
		||||
						"additionalProperties": false,
 | 
			
		||||
						"required": [
 | 
			
		||||
							"error"
 | 
			
		||||
						],
 | 
			
		||||
						"required": ["error"],
 | 
			
		||||
						"properties": {
 | 
			
		||||
							"result": {
 | 
			
		||||
								"nullable": true
 | 
			
		||||
@@ -76,4 +70,4 @@
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										33
									
								
								backend/embed/api_docs/paths/tokens/sse/post.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								backend/embed/api_docs/paths/tokens/sse/post.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,33 @@
 | 
			
		||||
{
 | 
			
		||||
	"operationId": "requestSSEToken",
 | 
			
		||||
	"summary": "Request a new SSE token",
 | 
			
		||||
	"tags": ["Tokens"],
 | 
			
		||||
	"responses": {
 | 
			
		||||
		"200": {
 | 
			
		||||
			"description": "200 response",
 | 
			
		||||
			"content": {
 | 
			
		||||
				"application/json": {
 | 
			
		||||
					"schema": {
 | 
			
		||||
						"required": ["result"],
 | 
			
		||||
						"properties": {
 | 
			
		||||
							"result": {
 | 
			
		||||
								"$ref": "#/components/schemas/TokenObject"
 | 
			
		||||
							}
 | 
			
		||||
						}
 | 
			
		||||
					},
 | 
			
		||||
					"examples": {
 | 
			
		||||
						"default": {
 | 
			
		||||
							"value": {
 | 
			
		||||
								"result": {
 | 
			
		||||
									"expires": 1566540510,
 | 
			
		||||
									"token": "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.ey...xaHKYr3Kk6MvkUjcC4",
 | 
			
		||||
									"scope": "user"
 | 
			
		||||
								}
 | 
			
		||||
							}
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user