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

WIP: Client API implementation #1119

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
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
Feb 22, 2017
90660e7
adding client interface back in
Feb 22, 2017
3fac89b
basic factory for local/remote client
Feb 23, 2017
b024930
clientapi works with cli
Feb 24, 2017
f2f3118
grpc interceptors are working, need to get proper token auth in place
endophage Mar 6, 2017
7760a77
regenerated certs for all the services and server side of tokens shou…
Mar 8, 2017
44656cc
grpc client needed GetGUN method to meet Repository interface
Mar 8, 2017
bc29fa6
fixing some interfaces
Mar 8, 2017
2386ae0
server side of producing a token is working
Mar 9, 2017
cc73b50
working token auth end to end
Mar 14, 2017
02415db
Add Target operations to client API protobuf definitions and generate…
n4ss Mar 7, 2017
a0095e8
Add ChangeList operations to client API protobuf definitions
n4ss Mar 7, 2017
904cf35
Add generated code for ChangeList grpc interface
n4ss Mar 7, 2017
7bba7ec
Add Init, Publish and returned Errors to client API gRPC interface
n4ss Mar 7, 2017
9066aa3
Add Role operations to client API gRPC interface with generated code
n4ss Mar 7, 2017
55ad281
Add remaining rpc definitions to client gRPC API interface
n4ss Mar 7, 2017
0da0e82
Implement client api ListTargets
n4ss Mar 11, 2017
8cd2776
Implement more client api calls
n4ss Mar 12, 2017
4d8d088
Implement more client api calls - part 2
n4ss Mar 12, 2017
6c0fd1e
Implement more client api calls - part 3
n4ss Mar 12, 2017
3c4ca95
Implement more client api calls - part 4
n4ss Mar 12, 2017
c5208b6
Implement more client api calls - part 5
n4ss Mar 13, 2017
822b5e4
Finish implementing main part of client API endpoint
n4ss Mar 13, 2017
1af5845
Switch Empty type to google protobuf's Empty type
n4ss Mar 13, 2017
dd7c918
Add cryptoservice interface to client api endpoint
n4ss Mar 13, 2017
1ad6d9d
Add missing response type and update generated files
n4ss Mar 13, 2017
adca046
Add client api prototypes to server interface
n4ss Mar 13, 2017
c63fb30
Fix cherry-pick conflicts
n4ss Mar 14, 2017
270b9f3
Add GUN parameters to client side of client api
n4ss Mar 14, 2017
158c945
Implement cient api server-side Init and Publish
n4ss Mar 14, 2017
8e3faf6
Implement more cient api server-side - part 2
n4ss Mar 15, 2017
ac1b131
Implement more cient api server-side - part 3
n4ss Mar 15, 2017
bb89cff
Finish cient api server-side implementation
n4ss Mar 15, 2017
c82dade
Fix cherry-pick conflicts
n4ss Mar 16, 2017
e21831c
moving around some of the auth stuff to collect it better in one plac…
Mar 17, 2017
e6e7e88
use relative path for API CA in cmd/notary/config.json so it works fo…
Mar 20, 2017
cdfd8df
removing test that was intentionally failing. I was just using it to …
Mar 20, 2017
bcc3abe
forward tokens from ClientAPI to notary server
Mar 30, 2017
297656c
configure key storage for clientapi
Mar 30, 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
252 changes: 252 additions & 0 deletions client_api/api/api.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions client_api/api/api.proto
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) {}
Copy link
Contributor

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


// 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;
}


10 changes: 10 additions & 0 deletions client_api/api/client.go
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
}
20 changes: 20 additions & 0 deletions client_api/api/errors.go
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)
}
}
5 changes: 5 additions & 0 deletions client_api/api/generator.go
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:.
Loading