mirror of
				https://github.com/juanfont/headscale.git
				synced 2025-11-04 01:51:04 +01:00 
			
		
		
		
	Switch to nodekey in urls
This commit is contained in:
		
							parent
							
								
									fb3b2e6bc8
								
							
						
					
					
						commit
						804d70386d
					
				
							
								
								
									
										2
									
								
								app.go
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								app.go
									
									
									
									
									
								
							@ -420,7 +420,7 @@ func (h *Headscale) createRouter(grpcMux *runtime.ServeMux) *mux.Router {
 | 
				
			|||||||
	router.HandleFunc("/register/{nkey}", h.RegisterWebAPI).Methods(http.MethodGet)
 | 
						router.HandleFunc("/register/{nkey}", h.RegisterWebAPI).Methods(http.MethodGet)
 | 
				
			||||||
	router.HandleFunc("/machine/{mkey}/map", h.PollNetMapHandler).Methods(http.MethodPost)
 | 
						router.HandleFunc("/machine/{mkey}/map", h.PollNetMapHandler).Methods(http.MethodPost)
 | 
				
			||||||
	router.HandleFunc("/machine/{mkey}", h.RegistrationHandler).Methods(http.MethodPost)
 | 
						router.HandleFunc("/machine/{mkey}", h.RegistrationHandler).Methods(http.MethodPost)
 | 
				
			||||||
	router.HandleFunc("/oidc/register/{mkey}", h.RegisterOIDC).Methods(http.MethodGet)
 | 
						router.HandleFunc("/oidc/register/{nkey}", h.RegisterOIDC).Methods(http.MethodGet)
 | 
				
			||||||
	router.HandleFunc("/oidc/callback", h.OIDCCallback).Methods(http.MethodGet)
 | 
						router.HandleFunc("/oidc/callback", h.OIDCCallback).Methods(http.MethodGet)
 | 
				
			||||||
	router.HandleFunc("/apple", h.AppleConfigMessage).Methods(http.MethodGet)
 | 
						router.HandleFunc("/apple", h.AppleConfigMessage).Methods(http.MethodGet)
 | 
				
			||||||
	router.HandleFunc("/apple/{platform}", h.ApplePlatformConfig).Methods(http.MethodGet)
 | 
						router.HandleFunc("/apple/{platform}", h.ApplePlatformConfig).Methods(http.MethodGet)
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										6
									
								
								oidc.go
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								oidc.go
									
									
									
									
									
								
							@ -68,8 +68,8 @@ func (h *Headscale) initOIDC() error {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// RegisterOIDC redirects to the OIDC provider for authentication
 | 
					// RegisterOIDC redirects to the OIDC provider for authentication
 | 
				
			||||||
// Puts node key in cache so the callback can retrieve it using the oidc state param
 | 
					// Puts NodeKey in cache so the callback can retrieve it using the oidc state param
 | 
				
			||||||
// Listens in /oidc/register/:mKey.
 | 
					// Listens in /oidc/register/:nKey.
 | 
				
			||||||
func (h *Headscale) RegisterOIDC(
 | 
					func (h *Headscale) RegisterOIDC(
 | 
				
			||||||
	writer http.ResponseWriter,
 | 
						writer http.ResponseWriter,
 | 
				
			||||||
	req *http.Request,
 | 
						req *http.Request,
 | 
				
			||||||
@ -135,7 +135,7 @@ var oidcCallbackTemplate = template.Must(
 | 
				
			|||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// OIDCCallback handles the callback from the OIDC endpoint
 | 
					// OIDCCallback handles the callback from the OIDC endpoint
 | 
				
			||||||
// Retrieves the mkey from the state cache and adds the machine to the users email namespace
 | 
					// Retrieves the nkey from the state cache and adds the machine to the users email namespace
 | 
				
			||||||
// TODO: A confirmation page for new machines should be added to avoid phishing vulnerabilities
 | 
					// TODO: A confirmation page for new machines should be added to avoid phishing vulnerabilities
 | 
				
			||||||
// TODO: Add groups information from OIDC tokens into machine HostInfo
 | 
					// TODO: Add groups information from OIDC tokens into machine HostInfo
 | 
				
			||||||
// Listens in /oidc/callback.
 | 
					// Listens in /oidc/callback.
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user