You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by ra...@apache.org on 2018/09/18 16:40:44 UTC
[trafficcontrol] 02/02: Change TO DS SSL update to use riaksvc const
This is an automated email from the ASF dual-hosted git repository.
rawlin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
commit c4965c1263d2bbdd8fe09905d4538ff539ec2445
Author: Robert Butts <ro...@apache.org>
AuthorDate: Mon Sep 17 16:39:24 2018 -0600
Change TO DS SSL update to use riaksvc const
---
traffic_ops/traffic_ops_golang/deliveryservice/sslkeys.go | 4 +---
traffic_ops/traffic_ops_golang/riaksvc/dsutil.go | 3 ++-
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/traffic_ops/traffic_ops_golang/deliveryservice/sslkeys.go b/traffic_ops/traffic_ops_golang/deliveryservice/sslkeys.go
index 0ab9916..d313608 100644
--- a/traffic_ops/traffic_ops_golang/deliveryservice/sslkeys.go
+++ b/traffic_ops/traffic_ops_golang/deliveryservice/sslkeys.go
@@ -51,8 +51,6 @@ func GenerateSSLKeys(w http.ResponseWriter, r *http.Request) {
api.WriteResp(w, r, "Successfully created ssl keys for "+*req.DeliveryService)
}
-const DSSSLKeyVersionLatest = `latest`
-
// generatePutRiakKeys generates a certificate, csr, and key from the given request, and insert it into the Riak key database.
// The req MUST be validated, ensuring required fields exist.
func generatePutRiakKeys(req tc.DeliveryServiceSSLKeysReq, tx *sql.Tx, cfg *config.Config) error {
@@ -81,7 +79,7 @@ func generatePutRiakKeys(req tc.DeliveryServiceSSLKeysReq, tx *sql.Tx, cfg *conf
return errors.New("putting riak keys: " + err.Error())
}
- dsSSLKeys.Version = DSSSLKeyVersionLatest
+ dsSSLKeys.Version = riaksvc.DSSSLKeyVersionLatest
if err := riaksvc.PutDeliveryServiceSSLKeysObjTx(dsSSLKeys, tx, cfg.RiakAuthOptions); err != nil {
return errors.New("putting latest riak keys: " + err.Error())
}
diff --git a/traffic_ops/traffic_ops_golang/riaksvc/dsutil.go b/traffic_ops/traffic_ops_golang/riaksvc/dsutil.go
index 2742ae5..24f3d57 100644
--- a/traffic_ops/traffic_ops_golang/riaksvc/dsutil.go
+++ b/traffic_ops/traffic_ops_golang/riaksvc/dsutil.go
@@ -32,7 +32,8 @@ import (
const DeliveryServiceSSLKeysBucket = "ssl"
const DNSSECKeysBucket = "dnssec"
-const DefaultDSSSLKeyVersion = "latest"
+const DSSSLKeyVersionLatest = "latest"
+const DefaultDSSSLKeyVersion = DSSSLKeyVersionLatest
const URLSigKeysBucket = "url_sig_keys"
func MakeDSSSLKeyKey(dsName, version string) string {