mirror of https://github.com/grafana/grafana.git
				
				
				
			Plugins: Fix descendent frontend plugin signature validation (#28638)
* move plugin root check to earlier in validation process * remove comment * only check root if necessary
This commit is contained in:
		
							parent
							
								
									2be217e026
								
							
						
					
					
						commit
						b9d71f5cdd
					
				|  | @ -373,12 +373,6 @@ func (scanner *PluginScanner) IsBackendOnlyPlugin(pluginType string) bool { | |||
| 
 | ||||
| // validateSignature validates a plugin's signature.
 | ||||
| func (s *PluginScanner) validateSignature(plugin *PluginBase) *PluginError { | ||||
| 	// For the time being, we choose to only require back-end plugins to be signed
 | ||||
| 	// NOTE: the state is calculated again when setting metadata on the object
 | ||||
| 	if !plugin.Backend || !s.requireSigned { | ||||
| 		return nil | ||||
| 	} | ||||
| 
 | ||||
| 	if plugin.Signature == PluginSignatureValid { | ||||
| 		s.log.Debug("Plugin has valid signature", "id", plugin.Id) | ||||
| 		return nil | ||||
|  | @ -403,6 +397,12 @@ func (s *PluginScanner) validateSignature(plugin *PluginBase) *PluginError { | |||
| 			"state", plugin.Signature) | ||||
| 	} | ||||
| 
 | ||||
| 	// For the time being, we choose to only require back-end plugins to be signed
 | ||||
| 	// NOTE: the state is calculated again when setting metadata on the object
 | ||||
| 	if !plugin.Backend || !s.requireSigned { | ||||
| 		return nil | ||||
| 	} | ||||
| 
 | ||||
| 	switch plugin.Signature { | ||||
| 	case PluginSignatureUnsigned: | ||||
| 		allowUnsigned := false | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue