Commit Graph
42 Commits
Author SHA1 Message Date
Jim 27b4d7a034 basic internal db interfaces and Gorm implementation
* db reader and writer interfaces which should allow us to encapsulate the vast majority of database code in this package.

* GormReadWriter implementation of the Reader and Writer interfaces
2020-05-05 13:29:47 -04:00
Jeff Mitchell 1519a17f17 Rename catalog flag to catalog-id in hosts create command 2020-05-05 11:21:37 -04:00
Jeff Mitchell 1f3c52f495 Name and addr updates (#26)
* Rename FriendlyName to Name

* Standardize on connection parameters for the server being addr

This syncs up WATCHTOWER_ADDR and -addr (formerly -address) and frees up
-address to be used in resources (which it is).

* Add description fields
2020-05-05 11:19:42 -04:00
Jeff Mitchell e3c7ca3070 Add a hosts create command (#25) 2020-05-04 23:04:55 -04:00
Jeff Mitchell 17fffe7c23 Add Response type and decoding (#24)
This may not be the final interface for responses but it is fine to
start.

Fix some bugs, e.g. require an org and project to be set.
2020-05-04 23:02:18 -04:00
Jeff Mitchell e31e91a5ad Add create function template and fix some minor template bugs (#23) 2020-05-04 22:59:45 -04:00
Jeff Mitchell 4afb4f6be5 Minor proto updates (#22) 2020-05-04 22:57:22 -04:00
Jeff Mitchell 6970b14143 Update type value to wrapper 2020-05-04 14:58:18 -04:00
Jeff Mitchell 6254e18698 Fix compilation of command 2020-05-04 12:41:36 -04:00
Jeff Mitchell 19f74a8247 Minor template cleanup 2020-05-04 12:09:57 -04:00
Jeff Mitchell be1063d168 Clean up and reorganize API generation 2020-05-04 11:23:35 -04:00
Jeff Mitchell 9325a6422d Remove timestamps in generated files 2020-05-04 11:04:17 -04:00
Jeff Mitchell 1f93aa2301 Port over apigen's Makefile and go.mod changes 2020-05-04 11:02:02 -04:00
Jeff Mitchell 2926cc1000 Add initial API generation bits (#20)
* Add initial API generation bits

* Revert accidental changes to oplog
2020-05-04 10:58:20 -04:00
Jeff Mitchell 7f03246c6f Add basic API client (#19) 2020-05-04 10:58:03 -04:00
Jim 2f0dd58f11 set default value in gorm tag, so database timestamp defaults will get set 2020-05-03 16:10:14 -04:00
Jim 73363d4c71 adapt to use structwrapping from go-kms-wrapping 2020-05-03 16:09:22 -04:00
Jeff Mitchell 13056e1f51 Migrate host resources to hosts package (#15)
Migrate host resources to hosts package and some other minor changes
2020-05-01 18:05:54 -04:00
Todd KnightandJeff Mitchell c7126ae69b Static Catalog Api definition (#12)
* Setup buf to see and process protos correctly.

This commit adds a proposed directory structure for protos.  Included is a rough draft of the Ec2Catalog protos.

* Add host and host_catalog service apis.

This also has for the first time the move away from holding individual ids for resources and instead using the full uri path as the api facing identifier.  There are some issues with the swagger generation stripping out the format of the path matching so currently only PATCH uses the approach I would like to move to.  In follow up commits I'll try to either get swagger to display the correct expected paths or I'll resolve if that is even needed by our clients.

* Move all protos and generated files to under the internal directory.

This also required updating the buf config to explicitly name the exluded linted proto files under oplog since previously /internal/ was listed as a root in buf.  Future commit will move oplog proto files to be with the others.

* Moved oplog related protos to under the proto directory and regenerated.

* Update the oplog protos to be compliant with buf lint.

* Clean up comments in tools.

* Merged in recent changes to oplog protos.

* Add resource result messages to contain the read only fields and separate them from the writable fields.

* Merge the ec2 catalog resources in with the more generic host_catalog resource.

* Cleaning the generated swagger.

This included adding summaries for each proto rpc method, Making the resources be the full fqn, removing the default error, and a few other tweaks.

* Make project plural in the paths.

* Adding the ability to add and remove hosts from a host set.

* Add the ignore result limit for host set request.

* Make size and host lists read only.

* Add documentation about what host references are allowed to be added.

* Remove ignore result limit when listing items.  These can be added in later.

* Add handlers and tests for unimplemented services.

* Add bootstrap target and update how tools are built (#13)

* Update tool installation method, add bootstrap target to makefile

* Changing org to orgs in all paths and org param to org_id.

* Adding tests for unimplemented service implementations.

Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
2020-05-01 12:38:01 -07:00
Todd Knight 4d86db6ba5 Introduce the proto directory structure. (#9)
* Setup buf to see and process protos correctly.

This commit adds a proposed directory structure for protos.  Included is a rough draft of the Ec2Catalog protos.

* Setup buf to see and process protos correctly.

This commit adds a proposed directory structure for protos, but leaves the existing oplog related protos alone.  Included is a rough draft of the Ec2Catalog protos.

* Update makefile and add script to generate the appropriate pb.go files.

* Add comment explaining google.golang.org/protobuf vs github.com/golang/protobuf

* Move all protos and generated files to under the internal directory.

This also required updating the buf config to explicitly name the excluded linted proto files under oplog since previously /internal/ was listed as a root in buf.  Future commit will move oplog proto files to be with the others.

* Moved oplog related protos to under the proto directory and regenerated.

* Update the oplog protos to be compliant with buf lint.
2020-04-28 11:20:37 -07:00
fca36970bf refactor replay, so that it creates the required tables during replay (#7)
Co-authored-by: Jim Lambert <jimlambrt@Jims-MBP-3.home>
Co-authored-by: Todd Knight <T.Alan.Knight@gmail.com>
2020-04-20 16:42:16 -04:00
Patrick Bernal 0fffb54501 Update jira_test.yml 2020-04-19 14:32:17 -04:00
Patrick Bernal dbcbc4e883 Update jira_test.yml 2020-04-19 14:31:16 -04:00
Patrick Bernal 063469c29e Update jira_test.yml 2020-04-15 14:45:40 -04:00
Patrick Bernal af4ccad566 Update jira_test.yml 2020-04-15 14:42:54 -04:00
Patrick Bernal 0ee97a8cbc Update jira_test.yml 2020-04-15 13:56:39 -04:00
Patrick Bernal bcfd245dd8 Update jira_test.yml 2020-04-14 18:56:42 -04:00
Patrick Bernal 9bbb501a7b Create jira_test.yml
testing a Jira create while opening an issue on GH
2020-04-14 18:14:20 -04:00
Jeff Mitchell e6533d966d Update go-kms-wrapping and go-hclog deps 2020-04-10 10:43:00 -04:00
34f530e0df Basic oplog capability (#6)
The ability to write oplog entries using a ticket based system to ensure serialization.   Uses a go-kms-wrapper for encrypting/decrypting entries.

Co-authored-by: Jim Lambert <jlm.lambert@gmail.com>
Co-authored-by: Michael Gaffney <mgaffney@users.noreply.github.com>
Co-authored-by: Todd Knight <T.Alan.Knight@gmail.com>
Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
2020-04-08 14:55:40 -04:00
Jeff Mitchell 6b0756ade9 Update go-kms-wrapping 2020-04-07 10:35:24 -04:00
Jeff Mitchell 5e82db8a2d Minor bugfixes and cleanup 2020-03-23 14:50:19 -04:00
Jeff Mitchell cad3c24f54 Add auth over ALPN (#5) 2020-03-22 20:17:23 -04:00
Jeff Mitchell 5acda6a0b1 Begin purpose-based listener refactoring (#4) 2020-03-22 08:27:24 -04:00
Jeff Mitchell 07032f6908 Refactoring and the worker is more distinct now (#3) 2020-03-20 12:51:39 -04:00
Jeff Mitchell 75dc91fdb6 Update alpnmux 2020-03-19 16:30:14 -04:00
Jeff Mitchell 1645c3106e Migrate a bunch of stuff around to prep for worker command (#2)
Right now it's essentially a copy; it needs some updating, integration
into dev, and so on.
2020-03-19 15:17:40 -04:00
Jeff Mitchell c2d385d851 Bump vault/g-k-w deps 2020-03-10 16:09:57 -04:00
Michael Gaffney 5e5a56cac0 Refactor names to avoid stutter (#1)
Since client code uses the package name as a prefix when referring to
the package contents, the names for those contents need not repeat the
package name.

- Rename base.BaseCommand to base.Command
- Rename base.BaseServer to base.Server
- Rename config.DevConfig() to config.Dev()
- Rename config.LoadConfigFile() to config.LoadFile()
- Rename config.NewConfig() to config.New()
- Rename config.ParseConfig() to config.Parse()
- Rename controller.ControllerCommand to controller.Command
- Rename controller.NewController() to controller.New()
- Rename dev.DevCommand to dev.Command
- Rename listener.ListenerFactory to listener.Factory
- Rename listener.NewListener() to listener.New()
- Rename version.GetVersion() to version.Get()
- Rename version.VersionInfo to version.Info

See:
- https://golang.org/doc/effective_go.html#package-names
- https://blog.golang.org/package-names#TOC_3.
- https://github.com/golang/go/wiki/CodeReviewComments#package-names
2020-03-10 15:48:04 -04:00
Jeff Mitchell 39c629631f Bump go-kms-wrapping 2020-03-09 10:50:22 -04:00
Jeff Mitchell 9c0f4d8806 Bump vault dep 2020-03-06 11:32:58 -05:00
Jeff Mitchell 482b4d56dd Initial commit 2020-03-04 12:51:46 -05:00