Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented TOTP Secret Backend #2492

Merged
merged 48 commits into from
May 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
f9f4cd0
Initialized basic outline of TOTP backend using Postgresql backend as…
mymercurialsky Mar 5, 2017
77a1694
Updated TOTP backend.go's structure and help string
mymercurialsky Mar 5, 2017
b04ab7e
Updated TOTP path_roles.go's structure and help strings
mymercurialsky Mar 5, 2017
f64f5b9
Updated TOTP path_role_create.go's structure and help strings
mymercurialsky Mar 5, 2017
49f3c0c
Fixed typo in path_roles.go
mymercurialsky Mar 5, 2017
3ede55c
Merge branch 'master' of https://github.com/hashicorp/vault
mymercurialsky Mar 5, 2017
f19b57f
Fixed errors in path_role_create.go and path_roles.go
mymercurialsky Mar 5, 2017
ff8fe83
Added TOTP secret backend information to cli commands
mymercurialsky Mar 5, 2017
4a222fd
Fixed build errors in path_roles.go and path_role_create.go
mymercurialsky Mar 5, 2017
44b681b
Changed field values of period and digits from uint to int, added uin…
mymercurialsky Mar 5, 2017
092e797
Initialized TOTP test file based on structure of postgresql test file
mymercurialsky Mar 6, 2017
7a97efa
Added enforcement of input values
mymercurialsky Mar 7, 2017
dd96080
Merge branch 'master' of https://github.com/hashicorp/vault
mymercurialsky Mar 7, 2017
d2b07be
Added otp library to vendor folder
mymercurialsky Mar 7, 2017
fb98943
Added test steps and cleaned up errors
mymercurialsky Mar 7, 2017
1a7fe62
Modified read credential test step, not working yet
mymercurialsky Mar 10, 2017
8d59054
Merge branch 'master' of https://github.com/hashicorp/vault
mymercurialsky Mar 10, 2017
3269056
Use of vendored package not allowed - Test error
mymercurialsky Mar 10, 2017
fcd0309
Removed vendor files for TOTP library
mymercurialsky Mar 12, 2017
6136a0f
Revert "Removed vendor files for TOTP library"
mymercurialsky Mar 12, 2017
2a122fc
Hopefully fixed vendor folder issue with TOTP Library
mymercurialsky Mar 12, 2017
3825e48
Added additional tests for TOTP backend
mymercurialsky Mar 15, 2017
07d5a2f
Cleaned up comments in TOTP backend_test.go
mymercurialsky Mar 15, 2017
9d2b862
Added default values of period, algorithm and digits to field schema
mymercurialsky Mar 17, 2017
0010233
Changed account_name and issuer fields to optional
mymercurialsky Mar 17, 2017
bf3d7a0
Removed MD5 as a hash algorithm option
mymercurialsky Mar 17, 2017
6dadf12
Implemented requested pull request changes
mymercurialsky Mar 20, 2017
5154092
Merge branch 'master' of https://github.com/hashicorp/vault
mymercurialsky Mar 24, 2017
dcdc86b
Added ability to validate TOTP codes
mymercurialsky Apr 3, 2017
748e51d
Added ability to have a key generated
mymercurialsky Apr 4, 2017
4d94de0
Added skew, qr size and key size parameters
mymercurialsky Apr 10, 2017
dda68be
Reset vendor.json prior to merge
mymercurialsky Apr 12, 2017
906b923
Merge branch 'master' of https://github.com/hashicorp/vault
mymercurialsky Apr 12, 2017
6e63357
Readded otp and barcode libraries to vendor.json
mymercurialsky Apr 12, 2017
0073a9e
Modified help strings for path_role_create.go
mymercurialsky Apr 12, 2017
a5aeda5
Fixed test issue in testAccStepReadRole
mymercurialsky Apr 13, 2017
2c69681
Cleaned up error formatting, variable names and path names. Also adde…
mymercurialsky Apr 15, 2017
2ce1a45
Moveed barcode and url output to key creation function and did some a…
mymercurialsky Apr 15, 2017
8bc9d2c
Added ability to pass in TOTP urls
mymercurialsky Apr 16, 2017
2b129fd
Added additional tests for TOTP server functions
mymercurialsky Apr 16, 2017
aa7be3d
Removed unused QRSize, URL and Generate members of keyEntry struct
mymercurialsky Apr 17, 2017
f307f8e
Removed unnecessary urlstring variable from pathKeyCreate
mymercurialsky Apr 18, 2017
72626e8
Added website documentation for TOTP secret backend
mymercurialsky Apr 23, 2017
8ea74b9
Added errors if generate is true and url or key is passed, removed lo…
mymercurialsky Apr 28, 2017
ec49229
Updated website documentation and added QR example
mymercurialsky Apr 28, 2017
fbabadd
Added exported variable and ability to disable QR generation, cleaned…
mymercurialsky May 3, 2017
0023345
Updated API documentation to inlude to exported variable and qr size …
mymercurialsky May 3, 2017
ecff38e
Cleaned up return statements in path_code, added error handling while…
mymercurialsky May 4, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions builtin/logical/totp/backend.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package totp

import (
"strings"

"github.com/hashicorp/vault/logical"
"github.com/hashicorp/vault/logical/framework"
)

func Factory(conf *logical.BackendConfig) (logical.Backend, error) {
return Backend(conf).Setup(conf)
}

func Backend(conf *logical.BackendConfig) *backend {
var b backend
b.Backend = &framework.Backend{
Help: strings.TrimSpace(backendHelp),

Paths: []*framework.Path{
pathListKeys(&b),
pathKeys(&b),
pathCode(&b),
},

Secrets: []*framework.Secret{},
}

return &b
}

type backend struct {
*framework.Backend
}

const backendHelp = `
The TOTP backend dynamically generates time-based one-time use passwords.
`
Loading