Skip to content

Commit

Permalink
Merge pull request #102 from C2FO/accept-multi-kex
Browse files Browse the repository at this point in the history
Allow commandline to specify multiple kex algos
  • Loading branch information
skduits authored Oct 6, 2021
2 parents 45e967c + d37ae0e commit f53cb6d
Show file tree
Hide file tree
Showing 75 changed files with 266 additions and 204 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]

## [6.0.0] - 2021-09-29
### Changed
- Modified sftp Key Exchange option to accept an array instead of a string, allowing multiple kex algorithms

### Upgrade steps

With v6.0.0, sftp.Options struct changed to accept an array of Key Exchange algorithms rather than a string. To update, change the syntax of the auth commands.
```
"keyExchanges":"diffie-hellman-group-a256"
```
becomes
```
"keyExchanges":["diffie-hellman-group-a256"]
```

## [5.10.0] - 2021-09-16
### Changed
- Modified S3 file.go so that on the initial read when the remote file is downloaded, a temporary file is locally created
Expand Down
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[![GitHub tag](https://img.shields.io/github/tag/c2fo/vfs.svg?style=flat)](https://github.com/c2fo/vfs/releases)
[![Build Status](https://travis-ci.org/C2FO/vfs.svg?branch=master)](https://travis-ci.org/C2FO/vfs)
[![GoDoc](https://pkg.go.dev/badge/github.com/c2fo/vfs/v5?utm_source=godoc)](https://pkg.go.dev/github.com/c2fo/vfs/v5)
[![GoDoc](https://pkg.go.dev/badge/github.com/c2fo/vfs/v6?utm_source=godoc)](https://pkg.go.dev/github.com/c2fo/vfs/v6)
[![codecov](https://codecov.io/gh/c2fo/vfs/branch/master/graph/badge.svg)](https://codecov.io/gh/c2fo/vfs)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](License.md)
[![Go Report Card](https://goreportcard.com/badge/github.com/c2fo/vfs)](https://goreportcard.com/report/github.com/c2fo/vfs)
Expand Down Expand Up @@ -60,10 +60,27 @@ file system backends.

### Install

Go install:
Pre 1.17:
```
go get -u github.com/c2fo/vfs/v6
```

Post 1.17:
```
go install -u github.com/c2fo/vfs/v6
```

go get -u github.com/c2fo/vfs/v5
### Upgrading

#### Upgrading from v5 to v6
With v6.0.0, sftp.Options struct changed to to accept an array of Key Exchange algorithms rather than a string. To update, change the syntax of the auth commands.
```
"keyExchanges":"diffie-hellman-group-a256"
```
becomes
```
"keyExchanges":["diffie-hellman-group-a256"]
```

### Usage

Expand Down
12 changes: 6 additions & 6 deletions backend/all/all.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
package all

import (
_ "github.com/c2fo/vfs/v5/backend/azure" // register azure backend
_ "github.com/c2fo/vfs/v5/backend/gs" // register gs backend
_ "github.com/c2fo/vfs/v5/backend/mem" // register mem backend
_ "github.com/c2fo/vfs/v5/backend/os" // register os backend
_ "github.com/c2fo/vfs/v5/backend/s3" // register s3 backend
_ "github.com/c2fo/vfs/v5/backend/sftp" // register sftp backend
_ "github.com/c2fo/vfs/v6/backend/azure" // register azure backend
_ "github.com/c2fo/vfs/v6/backend/gs" // register gs backend
_ "github.com/c2fo/vfs/v6/backend/mem" // register mem backend
_ "github.com/c2fo/vfs/v6/backend/os" // register os backend
_ "github.com/c2fo/vfs/v6/backend/s3" // register s3 backend
_ "github.com/c2fo/vfs/v6/backend/sftp" // register sftp backend
)
4 changes: 2 additions & 2 deletions backend/azure/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/Azure/azure-pipeline-go/pipeline"
"github.com/Azure/azure-storage-blob-go/azblob"

"github.com/c2fo/vfs/v5"
"github.com/c2fo/vfs/v5/utils"
"github.com/c2fo/vfs/v6"
"github.com/c2fo/vfs/v6/utils"
)

// The Client interface contains methods that perform specific operations to Azure Blob Storage. This interface is
Expand Down
6 changes: 3 additions & 3 deletions backend/azure/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Usage
Rely on github.com/c2fo/vfs/backend
import(
"github.com/c2fo/vfs/v5/backend"
"github.com/c2fo/vfs/v5/backend/azure"
"github.com/c2fo/vfs/v6/backend"
"github.com/c2fo/vfs/v6/backend/azure"
)
func UseFs() error {
Expand All @@ -17,7 +17,7 @@ Rely on github.com/c2fo/vfs/backend
Or call directly:
import "github.com/c2fo/vfs/v5/backend/azure"
import "github.com/c2fo/vfs/v6/backend/azure"
func DoSomething() {
fs := azure.NewFilesystem()
Expand Down
6 changes: 3 additions & 3 deletions backend/azure/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (

"github.com/Azure/azure-storage-blob-go/azblob"

"github.com/c2fo/vfs/v5"
"github.com/c2fo/vfs/v5/backend"
"github.com/c2fo/vfs/v5/utils"
"github.com/c2fo/vfs/v6"
"github.com/c2fo/vfs/v6/backend"
"github.com/c2fo/vfs/v6/utils"
)

// File implements the vfs.File interface for Azure Blob Storage
Expand Down
6 changes: 3 additions & 3 deletions backend/azure/fileSystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"regexp"
"strings"

"github.com/c2fo/vfs/v5"
"github.com/c2fo/vfs/v5/backend"
"github.com/c2fo/vfs/v5/utils"
"github.com/c2fo/vfs/v6"
"github.com/c2fo/vfs/v6/backend"
"github.com/c2fo/vfs/v6/utils"
)

// Scheme defines the scheme for the azure implementation
Expand Down
2 changes: 1 addition & 1 deletion backend/azure/fileSystem_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/stretchr/testify/suite"

"github.com/c2fo/vfs/v5"
"github.com/c2fo/vfs/v6"
)

type FileSystemTestSuite struct {
Expand Down
4 changes: 2 additions & 2 deletions backend/azure/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (

"github.com/stretchr/testify/suite"

"github.com/c2fo/vfs/v5"
"github.com/c2fo/vfs/v5/utils"
"github.com/c2fo/vfs/v6"
"github.com/c2fo/vfs/v6/utils"
)

type FileTestSuite struct {
Expand Down
4 changes: 2 additions & 2 deletions backend/azure/location.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"regexp"
"strings"

"github.com/c2fo/vfs/v5"
"github.com/c2fo/vfs/v5/utils"
"github.com/c2fo/vfs/v6"
"github.com/c2fo/vfs/v6/utils"
)

const errNilLocationReceiver = "azure.Location receiver pointer must be non-nil"
Expand Down
2 changes: 1 addition & 1 deletion backend/azure/location_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/stretchr/testify/suite"

"github.com/c2fo/vfs/v5"
"github.com/c2fo/vfs/v6"
)

type LocationTestSuite struct {
Expand Down
2 changes: 1 addition & 1 deletion backend/azure/mock_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/Azure/azure-storage-blob-go/azblob"

"github.com/c2fo/vfs/v5"
"github.com/c2fo/vfs/v6"
)

// MockAzureClient is a mock implementation of azure.Client.
Expand Down
2 changes: 1 addition & 1 deletion backend/azure/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package azure
import (
"os"

"github.com/c2fo/vfs/v5"
"github.com/c2fo/vfs/v6"

"github.com/Azure/azure-storage-blob-go/azblob"
)
Expand Down
2 changes: 1 addition & 1 deletion backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"sort"
"sync"

"github.com/c2fo/vfs/v5"
"github.com/c2fo/vfs/v6"
)

var mmu sync.RWMutex
Expand Down
2 changes: 1 addition & 1 deletion backend/backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/stretchr/testify/suite"

"github.com/c2fo/vfs/v5/mocks"
"github.com/c2fo/vfs/v6/mocks"
)

/**********************************
Expand Down
12 changes: 6 additions & 6 deletions backend/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ In this way, a caller of vfs backends can simply load the backend file system (a
// import backend and each backend you intend to use
import(
"github.com/c2fo/vfs/v5/backend"
"github.com/c2fo/vfs/v5/backend/os"
"github.com/c2fo/vfs/v5/backend/s3"
"github.com/c2fo/vfs/v6/backend"
"github.com/c2fo/vfs/v6/backend/os"
"github.com/c2fo/vfs/v6/backend/s3"
)
func main() {
Expand Down Expand Up @@ -43,8 +43,8 @@ Then ensure it registers itself on load:
import(
...
"github.com/c2fo/vfs/v5"
"github.com/c2fo/vfs/v5/backend"
"github.com/c2fo/vfs/v6"
"github.com/c2fo/vfs/v6/backend"
)
// IMPLEMENT vfs interfaces
Expand All @@ -59,7 +59,7 @@ Then do use it in some other package do
package MyExoticFileSystem
import(
"github.com/c2fo/vfs/v5/backend"
"github.com/c2fo/vfs/v6/backend"
"github.com/acme/myexoticfilesystem"
)
Expand Down
2 changes: 1 addition & 1 deletion backend/gs/bucketHandleWrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"cloud.google.com/go/storage"

"github.com/c2fo/vfs/v5"
"github.com/c2fo/vfs/v6"
)

// BucketHandle is an interface which contains a subset of the functions provided
Expand Down
6 changes: 3 additions & 3 deletions backend/gs/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Usage
Rely on github.com/c2fo/vfs/backend
import(
"github.com/c2fo/vfs/v5/backend"
"github.com/c2fo/vfs/v5/backend/gs"
"github.com/c2fo/vfs/v6/backend"
"github.com/c2fo/vfs/v6/backend/gs"
)
func UseFs() error {
Expand All @@ -17,7 +17,7 @@ Rely on github.com/c2fo/vfs/backend
Or call directly:
import "github.com/c2fo/vfs/v5/backend/gs"
import "github.com/c2fo/vfs/v6/backend/gs"
func DoSomething() {
fs := gs.NewFilesystem()
Expand Down
6 changes: 3 additions & 3 deletions backend/gs/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (

"cloud.google.com/go/storage"

"github.com/c2fo/vfs/v5"
"github.com/c2fo/vfs/v5/backend"
"github.com/c2fo/vfs/v5/utils"
"github.com/c2fo/vfs/v6"
"github.com/c2fo/vfs/v6/backend"
"github.com/c2fo/vfs/v6/utils"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions backend/gs/fileSystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"cloud.google.com/go/storage"
"golang.org/x/net/context"

"github.com/c2fo/vfs/v5"
"github.com/c2fo/vfs/v5/backend"
"github.com/c2fo/vfs/v5/utils"
"github.com/c2fo/vfs/v6"
"github.com/c2fo/vfs/v6/backend"
"github.com/c2fo/vfs/v6/utils"
)

// Scheme defines the file system type.
Expand Down
2 changes: 1 addition & 1 deletion backend/gs/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"

"github.com/c2fo/vfs/v5/utils"
"github.com/c2fo/vfs/v6/utils"
)

type fileTestSuite struct {
Expand Down
4 changes: 2 additions & 2 deletions backend/gs/location.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"cloud.google.com/go/storage"
"google.golang.org/api/iterator"

"github.com/c2fo/vfs/v5"
"github.com/c2fo/vfs/v5/utils"
"github.com/c2fo/vfs/v6"
"github.com/c2fo/vfs/v6/utils"
)

// Location implements vfs.Location for gs fs.
Expand Down
2 changes: 1 addition & 1 deletion backend/gs/location_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"

"github.com/c2fo/vfs/v5/utils"
"github.com/c2fo/vfs/v6/utils"

"github.com/fsouza/fake-gcs-server/fakestorage"
)
Expand Down
2 changes: 1 addition & 1 deletion backend/gs/objectHandleWrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"cloud.google.com/go/storage"
"google.golang.org/api/iterator"

"github.com/c2fo/vfs/v5"
"github.com/c2fo/vfs/v6"
)

// ObjectHandleWrapper is an interface which contains a subset of the functions provided
Expand Down
2 changes: 1 addition & 1 deletion backend/gs/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package gs
import (
"google.golang.org/api/option"

"github.com/c2fo/vfs/v5"
"github.com/c2fo/vfs/v6"
)

// Options holds Google Cloud Storage -specific options. Currently only client options are used.
Expand Down
2 changes: 1 addition & 1 deletion backend/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"io"

"github.com/c2fo/vfs/v5"
"github.com/c2fo/vfs/v6"
)

func ValidateCopySeekPosition(f vfs.File) error {
Expand Down
8 changes: 4 additions & 4 deletions backend/mem/doc.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/*
Package mem built-in mem lib VFS implementation.
Usage
Rely on github.com/c2fo/vfs/v5/backend
Rely on github.com/c2fo/vfs/v6/backend
import(
"github.com/c2fo/vfs/v5/backend"
"github.com/c2fo/vfs/v5/backend/mem"
"github.com/c2fo/vfs/v6/backend"
"github.com/c2fo/vfs/v6/backend/mem"
)
func UseFs() error {
fs := backend.Backend(mem.Scheme)
...
}
Or call directly:
import _mem "github.com/c2fo/vfs/v5/backend/mem"
import _mem "github.com/c2fo/vfs/v6/backend/mem"
func DoSomething() {
fs := _mem.NewFileSystem()
...
Expand Down
6 changes: 3 additions & 3 deletions backend/mem/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"sync"
"time"

"github.com/c2fo/vfs/v5"
"github.com/c2fo/vfs/v5/backend"
"github.com/c2fo/vfs/v5/utils"
"github.com/c2fo/vfs/v6"
"github.com/c2fo/vfs/v6/backend"
"github.com/c2fo/vfs/v6/utils"
)

//
Expand Down
Loading

0 comments on commit f53cb6d

Please sign in to comment.