veyron/services/security/discharger: Remove unused files.

These files don't seem to be needed anymore with the identity server.
Let's remove them?

Change-Id: I3a225279665d34354d7ddd059849face4c6db1ca
diff --git a/services/security/discharger/revoker.go b/services/security/discharger/revoker.go
deleted file mode 100644
index 8ccea7b..0000000
--- a/services/security/discharger/revoker.go
+++ /dev/null
@@ -1,97 +0,0 @@
-package discharger
-
-import (
-	"crypto/rand"
-	"crypto/sha256"
-	"encoding/hex"
-	"fmt"
-	"io/ioutil"
-	"os"
-	"path/filepath"
-	"sync"
-	ssecurity "veyron.io/veyron/veyron/services/security"
-	"veyron.io/veyron/veyron2/ipc"
-	"veyron.io/veyron/veyron2/security"
-	"veyron.io/veyron/veyron2/vom"
-)
-
-// The revocation caveats will be stored in a directory with a file for each.
-type revocationDir string
-
-// Returns whether the caveat exists in the recovation file.
-func (dir revocationDir) exists(cav string) (bool, error) {
-	if len(dir) == 0 {
-		return false, fmt.Errorf("missing call to NewRecocationCaveat")
-	}
-	_, err := os.Stat(filepath.Join(string(dir), cav))
-	return !os.IsNotExist(err), nil
-}
-
-func (dir revocationDir) put(caveatNonce string, caveatPreimage []byte) error {
-	if len(dir) == 0 {
-		return fmt.Errorf("missing call to NewRevoker")
-	}
-	return ioutil.WriteFile(filepath.Join(string(dir), caveatNonce), caveatPreimage, 0600)
-}
-
-func (dir revocationDir) Revoke(ctx ipc.ServerContext, caveatPreimage ssecurity.RevocationToken) error {
-	if len(dir) == 0 {
-		return fmt.Errorf("missing call to NewRevoker")
-	}
-	caveatNonce := sha256.Sum256(caveatPreimage[:])
-	return revocationService.put(hex.EncodeToString(caveatNonce[:]), caveatPreimage[:])
-}
-
-var revocationService struct {
-	revocationDir
-	sync.Mutex
-}
-
-type revocationCaveat [32]byte
-
-func (cav revocationCaveat) Validate(security.Context) error {
-	exists, err := revocationService.exists(hex.EncodeToString(cav[:]))
-	if err != nil {
-		return err
-	}
-	if exists {
-		return fmt.Errorf("revoked")
-	}
-	return nil
-}
-
-// NewRevocationCaveat returns a security.ThirdPartyCaveat that discharger will
-// mint discharges until explicitly told not to by calling Revoke on it
-// (using the returned revocation token)
-func NewRevocationCaveat(dischargerID security.PublicID, dischargerLocation string) (ssecurity.RevocationToken, security.ThirdPartyCaveat, error) {
-	var revocation ssecurity.RevocationToken
-	if _, err := rand.Read(revocation[:]); err != nil {
-		return revocation, nil, err
-	}
-	restriction, err := security.NewCaveat(revocationCaveat(sha256.Sum256(revocation[:])))
-	if err != nil {
-		return revocation, nil, err
-	}
-	cav, err := security.NewPublicKeyCaveat(dischargerID.PublicKey(), dischargerLocation, security.ThirdPartyRequirements{}, restriction)
-	return revocation, cav, err
-}
-
-// NewRevoker returns a revoker service implementation that persists information about revocations on the filesystem in dir.
-// Can only be called once due to global variables.
-func NewRevoker(dir string) (ssecurity.RevokerService, error) {
-	revocationService.Lock()
-	defer revocationService.Unlock()
-	if len(revocationService.revocationDir) > 0 {
-		return nil, fmt.Errorf("revoker.Revoker called more than once.")
-	}
-	revocationService.revocationDir = revocationDir(dir)
-
-	// create the directory if not already there.
-	os.MkdirAll(dir, 0700)
-
-	return revocationService.revocationDir, nil
-}
-
-func init() {
-	vom.Register(revocationCaveat{})
-}
diff --git a/services/security/discharger/revoker_test.go b/services/security/discharger/revoker_test.go
deleted file mode 100644
index abc56a3..0000000
--- a/services/security/discharger/revoker_test.go
+++ /dev/null
@@ -1,97 +0,0 @@
-package discharger
-
-import (
-	"os"
-	"path/filepath"
-	"testing"
-
-	"veyron.io/veyron/veyron2"
-	"veyron.io/veyron/veyron2/ipc"
-	"veyron.io/veyron/veyron2/naming"
-	"veyron.io/veyron/veyron2/rt"
-	"veyron.io/veyron/veyron2/security"
-
-	_ "veyron.io/veyron/veyron/profiles"
-	services "veyron.io/veyron/veyron/services/security"
-)
-
-func revokerSetup(t *testing.T) (dischargerID security.PublicID, dischargerEndpoint, revokerEndpoint string, closeFunc func(), runtime veyron2.Runtime) {
-	var revokerDirPath = filepath.Join(os.TempDir(), "revoker_test_dir")
-	r := rt.Init()
-	// Create and start revoker and revocation discharge service
-	revokerServer, err := r.NewServer()
-	if err != nil {
-		t.Fatalf("rt.R().NewServer: %s", err)
-	}
-	revokerEP, err := revokerServer.Listen("tcp", "127.0.0.1:0")
-	if err != nil {
-		t.Fatalf("revokerServer.Listen failed: %v", err)
-	}
-	revokerService, err := NewRevoker(revokerDirPath)
-	if err != nil {
-		t.Fatalf("NewRevoker failed: $v", err)
-	}
-	revokerServiceStub := services.NewServerRevoker(revokerService)
-	err = revokerServer.Serve("", ipc.LeafDispatcher(revokerServiceStub, nil))
-	if err != nil {
-		t.Fatalf("revokerServer.Serve discharger: %s", err)
-	}
-
-	dischargerServer, err := r.NewServer()
-	if err != nil {
-		t.Fatalf("rt.R().NewServer: %s", err)
-	}
-	dischargerEP, err := dischargerServer.Listen("tcp", "127.0.0.1:0")
-	if err != nil {
-		t.Fatalf("dischargerServer.Listen failed: %v", err)
-	}
-	dischargerServiceStub := services.NewServerDischarger(NewDischarger(r.Identity()))
-	if err := dischargerServer.Serve("", ipc.LeafDispatcher(dischargerServiceStub, nil)); err != nil {
-		t.Fatalf("dischargerServer.Serve revoker: %s", err)
-	}
-	return r.Identity().PublicID(),
-		naming.JoinAddressName(dischargerEP.String(), ""),
-		naming.JoinAddressName(revokerEP.String(), ""),
-		func() {
-			defer os.RemoveAll(revokerDirPath)
-			revokerServer.Stop()
-			dischargerServer.Stop()
-		},
-		r
-}
-
-func TestDischargeRevokeDischargeRevokeDischarge(t *testing.T) {
-	dcID, dc, rv, closeFunc, r := revokerSetup(t)
-	defer closeFunc()
-	revoker, err := services.BindRevoker(rv)
-	if err != nil {
-		t.Fatalf("error binding to server: ", err)
-	}
-	discharger, err := services.BindDischarger(dc)
-	if err != nil {
-		t.Fatalf("error binding to server: ", err)
-	}
-
-	preimage, cav, err := NewRevocationCaveat(dcID, dc)
-	if err != nil {
-		t.Fatalf("failed to create public key caveat: %s", err)
-	}
-
-	var impetus security.DischargeImpetus
-
-	if _, err = discharger.Discharge(r.NewContext(), cav, impetus); err != nil {
-		t.Fatalf("failed to get discharge: %s", err)
-	}
-	if err = revoker.Revoke(r.NewContext(), preimage); err != nil {
-		t.Fatalf("failed to revoke: %s", err)
-	}
-	if discharge, err := discharger.Discharge(r.NewContext(), cav, impetus); err == nil || discharge != nil {
-		t.Fatalf("got a discharge for a revoked caveat: %s", err)
-	}
-	if err = revoker.Revoke(r.NewContext(), preimage); err != nil {
-		t.Fatalf("failed to revoke again: %s", err)
-	}
-	if discharge, err := discharger.Discharge(r.NewContext(), cav, impetus); err == nil || discharge != nil {
-		t.Fatalf("got a discharge for a doubly revoked caveat: %s", err)
-	}
-}
diff --git a/services/security/discharger/schema.vdl b/services/security/discharger/schema.vdl
deleted file mode 100644
index d92d035..0000000
--- a/services/security/discharger/schema.vdl
+++ /dev/null
@@ -1,3 +0,0 @@
-package discharger
-
-type Dir struct {} // TODO(tilaks, andreser): move this to store?
diff --git a/services/security/discharger/schema.vdl.go b/services/security/discharger/schema.vdl.go
deleted file mode 100644
index 462d255..0000000
--- a/services/security/discharger/schema.vdl.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by the veyron vdl tool.
-// Source: schema.vdl
-
-package discharger
-
-type Dir struct {
-} // TODO(tilaks, andreser): move this to store?
diff --git a/services/security/revoker.vdl b/services/security/revoker.vdl
deleted file mode 100644
index 00f86dd..0000000
--- a/services/security/revoker.vdl
+++ /dev/null
@@ -1,27 +0,0 @@
-package security
-
-import "veyron.io/veyron/veyron2/security"
-
-// RevocationToken can be presented to a revocation service to revoke a caveat
-type RevocationToken [16]byte
-
-// Revoker is the interface for preventing discharges from being issued. The
-// dicharger ensures that no discharges will be issued for caveats that
-// have been explicitly revoked using this interface. To prevent discharge
-// stealing caveats just have to be unique; the exact structure is not relevant
-// to the client or the verifier. To make Revoker's job easy, each caveat
-// contains a SHA256 hash of its revocation token. To revoke a caveat C and
-// have it added to the discharger's blacklist, one simply needs to call
-// Revoke(x) with an x s.t.  SHA256(x) = C. All caveats for which this has not
-// been revoked will get discharges, irrespective of who created them. This
-// means that the existence of a valid discharge does not imply that a
-// corresponding caveat exists, and even if it does, it may not be meant for
-// use with this revocation service. Just looking at discharges is meaningless,
-// a valid (Caveat, Discharge) pair is what can be relied on for
-// authentication. Not keeping track of non-revoked caveats enables
-// performance improvements on the Discharger side.
-type Revoker interface {
-	// Revoke ensures that iff a nil is returned, all discharge requests to the
-	// caveat with nonce sha256(caveatPreimage) are going to be denied.
-	Revoke(caveatPreimage RevocationToken) error {security.WriteLabel}
-}
diff --git a/services/security/revoker.vdl.go b/services/security/revoker.vdl.go
deleted file mode 100644
index 69164c4..0000000
--- a/services/security/revoker.vdl.go
+++ /dev/null
@@ -1,209 +0,0 @@
-// This file was auto-generated by the veyron vdl tool.
-// Source: revoker.vdl
-
-package security
-
-import (
-	"veyron.io/veyron/veyron2/security"
-
-	// The non-user imports are prefixed with "_gen_" to prevent collisions.
-	_gen_veyron2 "veyron.io/veyron/veyron2"
-	_gen_context "veyron.io/veyron/veyron2/context"
-	_gen_ipc "veyron.io/veyron/veyron2/ipc"
-	_gen_naming "veyron.io/veyron/veyron2/naming"
-	_gen_vdlutil "veyron.io/veyron/veyron2/vdl/vdlutil"
-	_gen_wiretype "veyron.io/veyron/veyron2/wiretype"
-)
-
-// RevocationToken can be presented to a revocation service to revoke a caveat
-type RevocationToken [16]byte
-
-// TODO(bprosnitz) Remove this line once signatures are updated to use typevals.
-// It corrects a bug where _gen_wiretype is unused in VDL pacakges where only bootstrap types are used on interfaces.
-const _ = _gen_wiretype.TypeIDInvalid
-
-// Revoker is the interface for preventing discharges from being issued. The
-// dicharger ensures that no discharges will be issued for caveats that
-// have been explicitly revoked using this interface. To prevent discharge
-// stealing caveats just have to be unique; the exact structure is not relevant
-// to the client or the verifier. To make Revoker's job easy, each caveat
-// contains a SHA256 hash of its revocation token. To revoke a caveat C and
-// have it added to the discharger's blacklist, one simply needs to call
-// Revoke(x) with an x s.t.  SHA256(x) = C. All caveats for which this has not
-// been revoked will get discharges, irrespective of who created them. This
-// means that the existence of a valid discharge does not imply that a
-// corresponding caveat exists, and even if it does, it may not be meant for
-// use with this revocation service. Just looking at discharges is meaningless,
-// a valid (Caveat, Discharge) pair is what can be relied on for
-// authentication. Not keeping track of non-revoked caveats enables
-// performance improvements on the Discharger side.
-// Revoker is the interface the client binds and uses.
-// Revoker_ExcludingUniversal is the interface without internal framework-added methods
-// to enable embedding without method collisions.  Not to be used directly by clients.
-type Revoker_ExcludingUniversal interface {
-	// Revoke ensures that iff a nil is returned, all discharge requests to the
-	// caveat with nonce sha256(caveatPreimage) are going to be denied.
-	Revoke(ctx _gen_context.T, caveatPreimage RevocationToken, opts ..._gen_ipc.CallOpt) (err error)
-}
-type Revoker interface {
-	_gen_ipc.UniversalServiceMethods
-	Revoker_ExcludingUniversal
-}
-
-// RevokerService is the interface the server implements.
-type RevokerService interface {
-
-	// Revoke ensures that iff a nil is returned, all discharge requests to the
-	// caveat with nonce sha256(caveatPreimage) are going to be denied.
-	Revoke(context _gen_ipc.ServerContext, caveatPreimage RevocationToken) (err error)
-}
-
-// BindRevoker returns the client stub implementing the Revoker
-// interface.
-//
-// If no _gen_ipc.Client is specified, the default _gen_ipc.Client in the
-// global Runtime is used.
-func BindRevoker(name string, opts ..._gen_ipc.BindOpt) (Revoker, error) {
-	var client _gen_ipc.Client
-	switch len(opts) {
-	case 0:
-		// Do nothing.
-	case 1:
-		if clientOpt, ok := opts[0].(_gen_ipc.Client); opts[0] == nil || ok {
-			client = clientOpt
-		} else {
-			return nil, _gen_vdlutil.ErrUnrecognizedOption
-		}
-	default:
-		return nil, _gen_vdlutil.ErrTooManyOptionsToBind
-	}
-	stub := &clientStubRevoker{defaultClient: client, name: name}
-
-	return stub, nil
-}
-
-// NewServerRevoker creates a new server stub.
-//
-// It takes a regular server implementing the RevokerService
-// interface, and returns a new server stub.
-func NewServerRevoker(server RevokerService) interface{} {
-	return &ServerStubRevoker{
-		service: server,
-	}
-}
-
-// clientStubRevoker implements Revoker.
-type clientStubRevoker struct {
-	defaultClient _gen_ipc.Client
-	name          string
-}
-
-func (__gen_c *clientStubRevoker) client(ctx _gen_context.T) _gen_ipc.Client {
-	if __gen_c.defaultClient != nil {
-		return __gen_c.defaultClient
-	}
-	return _gen_veyron2.RuntimeFromContext(ctx).Client()
-}
-
-func (__gen_c *clientStubRevoker) Revoke(ctx _gen_context.T, caveatPreimage RevocationToken, opts ..._gen_ipc.CallOpt) (err error) {
-	var call _gen_ipc.Call
-	if call, err = __gen_c.client(ctx).StartCall(ctx, __gen_c.name, "Revoke", []interface{}{caveatPreimage}, opts...); err != nil {
-		return
-	}
-	if ierr := call.Finish(&err); ierr != nil {
-		err = ierr
-	}
-	return
-}
-
-func (__gen_c *clientStubRevoker) UnresolveStep(ctx _gen_context.T, opts ..._gen_ipc.CallOpt) (reply []string, err error) {
-	var call _gen_ipc.Call
-	if call, err = __gen_c.client(ctx).StartCall(ctx, __gen_c.name, "UnresolveStep", nil, opts...); err != nil {
-		return
-	}
-	if ierr := call.Finish(&reply, &err); ierr != nil {
-		err = ierr
-	}
-	return
-}
-
-func (__gen_c *clientStubRevoker) Signature(ctx _gen_context.T, opts ..._gen_ipc.CallOpt) (reply _gen_ipc.ServiceSignature, err error) {
-	var call _gen_ipc.Call
-	if call, err = __gen_c.client(ctx).StartCall(ctx, __gen_c.name, "Signature", nil, opts...); err != nil {
-		return
-	}
-	if ierr := call.Finish(&reply, &err); ierr != nil {
-		err = ierr
-	}
-	return
-}
-
-func (__gen_c *clientStubRevoker) GetMethodTags(ctx _gen_context.T, method string, opts ..._gen_ipc.CallOpt) (reply []interface{}, err error) {
-	var call _gen_ipc.Call
-	if call, err = __gen_c.client(ctx).StartCall(ctx, __gen_c.name, "GetMethodTags", []interface{}{method}, opts...); err != nil {
-		return
-	}
-	if ierr := call.Finish(&reply, &err); ierr != nil {
-		err = ierr
-	}
-	return
-}
-
-// ServerStubRevoker wraps a server that implements
-// RevokerService and provides an object that satisfies
-// the requirements of veyron2/ipc.ReflectInvoker.
-type ServerStubRevoker struct {
-	service RevokerService
-}
-
-func (__gen_s *ServerStubRevoker) GetMethodTags(call _gen_ipc.ServerCall, method string) ([]interface{}, error) {
-	// TODO(bprosnitz) GetMethodTags() will be replaces with Signature().
-	// Note: This exhibits some weird behavior like returning a nil error if the method isn't found.
-	// This will change when it is replaced with Signature().
-	switch method {
-	case "Revoke":
-		return []interface{}{security.Label(4)}, nil
-	default:
-		return nil, nil
-	}
-}
-
-func (__gen_s *ServerStubRevoker) Signature(call _gen_ipc.ServerCall) (_gen_ipc.ServiceSignature, error) {
-	result := _gen_ipc.ServiceSignature{Methods: make(map[string]_gen_ipc.MethodSignature)}
-	result.Methods["Revoke"] = _gen_ipc.MethodSignature{
-		InArgs: []_gen_ipc.MethodArgument{
-			{Name: "caveatPreimage", Type: 66},
-		},
-		OutArgs: []_gen_ipc.MethodArgument{
-			{Name: "", Type: 67},
-		},
-	}
-
-	result.TypeDefs = []_gen_vdlutil.Any{
-		_gen_wiretype.NamedPrimitiveType{Type: 0x32, Name: "byte", Tags: []string(nil)}, _gen_wiretype.ArrayType{Elem: 0x41, Len: 0x10, Name: "veyron.io/veyron/veyron/services/security.RevocationToken", Tags: []string(nil)}, _gen_wiretype.NamedPrimitiveType{Type: 0x1, Name: "error", Tags: []string(nil)}}
-
-	return result, nil
-}
-
-func (__gen_s *ServerStubRevoker) UnresolveStep(call _gen_ipc.ServerCall) (reply []string, err error) {
-	if unresolver, ok := __gen_s.service.(_gen_ipc.Unresolver); ok {
-		return unresolver.UnresolveStep(call)
-	}
-	if call.Server() == nil {
-		return
-	}
-	var published []string
-	if published, err = call.Server().Published(); err != nil || published == nil {
-		return
-	}
-	reply = make([]string, len(published))
-	for i, p := range published {
-		reply[i] = _gen_naming.Join(p, call.Name())
-	}
-	return
-}
-
-func (__gen_s *ServerStubRevoker) Revoke(call _gen_ipc.ServerCall, caveatPreimage RevocationToken) (err error) {
-	err = __gen_s.service.Revoke(call, caveatPreimage)
-	return
-}