mirror of https://github.com/docker/docs.git
				
				
				
			Resolving rebase conflicts
Signed-off-by: David Lawrence <david.lawrence@docker.com> Signed-off-by: Diogo Monica <diogo@docker.com> (github: endophage)
This commit is contained in:
		
							parent
							
								
									8902c8c0e9
								
							
						
					
					
						commit
						68992ddaf5
					
				|  | @ -98,50 +98,6 @@ func NewTarget(targetName string, targetPath string) (*Target, error) { | |||
| 	return &Target{Name: targetName, Hashes: meta.Hashes, Length: meta.Length}, nil | ||||
| } | ||||
| 
 | ||||
| // NewNotaryRepository is a helper method that returns a new notary repository.
 | ||||
| // It takes the base directory under where all the trust files will be stored
 | ||||
| // (usually ~/.docker/trust/).
 | ||||
| func NewNotaryRepository(baseDir, gun, baseURL string, rt http.RoundTripper, | ||||
| 	passphraseRetriever passphrase.Retriever) (*NotaryRepository, error) { | ||||
| 
 | ||||
| 	keysPath := filepath.Join(baseDir, keystoremanager.PrivDir) | ||||
| 	fileKeyStore, err := trustmanager.NewKeyFileStore(keysPath, passphraseRetriever) | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 
 | ||||
| 	keyStoreManager, err := keystoremanager.NewKeyStoreManager(baseDir, fileKeyStore) | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 
 | ||||
| 	yubiKeyStore := api.NewYubiKeyStore(passphraseRetriever) | ||||
| 	cryptoService := cryptoservice.NewCryptoService(gun, yubiKeyStore, fileKeyStore) | ||||
| 
 | ||||
| 	nRepo := &NotaryRepository{ | ||||
| 		gun:             gun, | ||||
| 		baseDir:         baseDir, | ||||
| 		baseURL:         baseURL, | ||||
| 		tufRepoPath:     filepath.Join(baseDir, tufDir, filepath.FromSlash(gun)), | ||||
| 		CryptoService:   cryptoService, | ||||
| 		roundTrip:       rt, | ||||
| 		KeyStoreManager: keyStoreManager, | ||||
| 	} | ||||
| 
 | ||||
| 	fileStore, err := store.NewFilesystemStore( | ||||
| 		nRepo.tufRepoPath, | ||||
| 		"metadata", | ||||
| 		"json", | ||||
| 		"", | ||||
| 	) | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	nRepo.fileStore = fileStore | ||||
| 
 | ||||
| 	return nRepo, nil | ||||
| } | ||||
| 
 | ||||
| // Initialize creates a new repository by using rootKey as the root Key for the
 | ||||
| // TUF repository.
 | ||||
| func (r *NotaryRepository) Initialize(rootKeyID string) error { | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue