-
Notifications
You must be signed in to change notification settings - Fork 508
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
WIP: Client API implementation #1119
Closed
Closed
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
fa13191
add initial client api code
90660e7
adding client interface back in
3fac89b
basic factory for local/remote client
b024930
clientapi works with cli
f2f3118
grpc interceptors are working, need to get proper token auth in place
endophage 7760a77
regenerated certs for all the services and server side of tokens shou…
44656cc
grpc client needed GetGUN method to meet Repository interface
bc29fa6
fixing some interfaces
2386ae0
server side of producing a token is working
cc73b50
working token auth end to end
02415db
Add Target operations to client API protobuf definitions and generate…
n4ss a0095e8
Add ChangeList operations to client API protobuf definitions
n4ss 904cf35
Add generated code for ChangeList grpc interface
n4ss 7bba7ec
Add Init, Publish and returned Errors to client API gRPC interface
n4ss 9066aa3
Add Role operations to client API gRPC interface with generated code
n4ss 55ad281
Add remaining rpc definitions to client gRPC API interface
n4ss 0da0e82
Implement client api ListTargets
n4ss 8cd2776
Implement more client api calls
n4ss 4d8d088
Implement more client api calls - part 2
n4ss 6c0fd1e
Implement more client api calls - part 3
n4ss 3c4ca95
Implement more client api calls - part 4
n4ss c5208b6
Implement more client api calls - part 5
n4ss 822b5e4
Finish implementing main part of client API endpoint
n4ss 1af5845
Switch Empty type to google protobuf's Empty type
n4ss dd7c918
Add cryptoservice interface to client api endpoint
n4ss 1ad6d9d
Add missing response type and update generated files
n4ss adca046
Add client api prototypes to server interface
n4ss c63fb30
Fix cherry-pick conflicts
n4ss 270b9f3
Add GUN parameters to client side of client api
n4ss 158c945
Implement cient api server-side Init and Publish
n4ss 8e3faf6
Implement more cient api server-side - part 2
n4ss ac1b131
Implement more cient api server-side - part 3
n4ss bb89cff
Finish cient api server-side implementation
n4ss c82dade
Fix cherry-pick conflicts
n4ss e21831c
moving around some of the auth stuff to collect it better in one plac…
e6e7e88
use relative path for API CA in cmd/notary/config.json so it works fo…
cdfd8df
removing test that was intentionally failing. I was just using it to …
bcc3abe
forward tokens from ClientAPI to notary server
297656c
configure key storage for clientapi
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
syntax = "proto3"; | ||
|
||
package api; | ||
|
||
// Notary Interface | ||
service Notary { | ||
// AddTarget adds a target to the TUF repository and re-signs. | ||
rpc AddTarget(TargetAction) returns (BasicResponse) {} | ||
|
||
// RemoveTarget deletes a target from the TUF repository and re-signs. It only | ||
// uses the `name` field from the Target object, ignoring all other fields | ||
rpc RemoveTarget(TargetAction) returns (BasicResponse) {} | ||
} | ||
|
||
// Target message describes a TUF target. | ||
message TargetAction { | ||
string gun = 1; | ||
string name = 2; | ||
int64 length = 3; | ||
map<string, bytes> hashes = 4; | ||
bytes custom = 5; | ||
} | ||
|
||
// BasicResponse describes a response with a true/false success indicator, | ||
// and if false, an error type and message. See the errors.go file in this | ||
// package for the possible errors and a translation function between the | ||
// BasicResponse object and a concrete error type. | ||
message BasicResponse { | ||
bool success = 1; | ||
string message = 2; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package api | ||
|
||
import "google.golang.org/grpc" | ||
|
||
type Client struct {} | ||
|
||
func NewClient(conn *grpc.ClientConn) (NotaryClient, error) { | ||
|
||
return NewNotaryClient(conn), nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package api | ||
|
||
type ErrUnknown struct { | ||
msg string | ||
} | ||
|
||
func NewErrorUnknown(msg string) error { | ||
return ErrUnknown{msg: msg} | ||
} | ||
|
||
func (err ErrUnknown) Error() string { | ||
return err.msg | ||
} | ||
|
||
func translateAPIError(t string, msg string) error { | ||
switch t{ | ||
default: | ||
return NewErrorUnknown(msg) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package api | ||
|
||
// this file exists solely to allow us to use `go generate` to build our | ||
// compiled GRPC interface for Go. | ||
//go:generate protoc -I ./ ./api.proto --go_out=plugins=grpc:. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these take an optional list of roles to sign with? I know the default is to sign with all available, but that might not be the desired behavior when we get to thresholding