-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from zluudg/leon/globally-update-mqtt-topic
Support global config of mqtt-source being pushed from core
- Loading branch information
Showing
7 changed files
with
148 additions
and
12 deletions.
There are no files selected for viewing
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
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
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
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,54 @@ | ||
package main | ||
|
||
import ( | ||
"crypto/ecdsa" | ||
"log" | ||
"os" | ||
|
||
"github.com/dnstapir/tapir" | ||
"gopkg.in/yaml.v3" | ||
) | ||
|
||
func genKeyStore() map[string]string { | ||
var ks = make(map[string]string) | ||
keyStoreData, err := os.ReadFile(Gconfig.KeyStore.Path) | ||
|
||
if err != nil { | ||
log.Fatalf("Error from ReadFile(%s): %v", Gconfig.KeyStore.Path, err) | ||
} | ||
|
||
err = yaml.Unmarshal(keyStoreData, &ks) | ||
if err != nil { | ||
log.Fatalf("Error when unmarshaling keystore contents: %v", err) | ||
} | ||
|
||
return ks | ||
} | ||
|
||
func GetValidationKeyByKeyName(keyname string) *ecdsa.PublicKey { | ||
ks := genKeyStore() | ||
|
||
|
||
key, err := tapir.FetchMqttValidatorKey("KEYSTORE: "+ keyname, ks[keyname]) | ||
|
||
if err != nil { | ||
log.Printf("Error getting key %s from keystore", keyname) | ||
return nil | ||
} | ||
|
||
return key | ||
} | ||
|
||
// Unused, for now | ||
func GetSigningKeyByKeyName(keyname string) *ecdsa.PrivateKey { | ||
ks := genKeyStore() | ||
|
||
key, err := tapir.FetchMqttSigningKey("KEYSTORE: "+ keyname, ks[keyname]) | ||
|
||
if err != nil { | ||
log.Printf("Error getting key %s from keystore", keyname) | ||
return nil | ||
} | ||
|
||
return key | ||
} |
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,2 @@ | ||
tapir-analyze-pubkey: /etc/dnstapir/certs/tapir-analyze.pub | ||
tapir-mgmt-debug-pubkey: /etc/dnstapir/certs/tapir-analyze.pub |
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 |
---|---|---|
@@ -1,8 +1,16 @@ | ||
globalconfig: | ||
tapirconfigversion: 17 | ||
rpz: | ||
envelopesize: 400 | ||
bootstrap: | ||
servers: [ 77.72.231.135:5454, 1.2.3.4:1234 ] | ||
baseurl: https://%s/api/v1/ | ||
apikey: be-lean-and-mean-and-in-between | ||
tapirconfigversion: 17 | ||
rpz: | ||
envelopesize: 400 | ||
bootstrap: | ||
servers: [ ] | ||
baseurl: https://%s/api/v1/ | ||
apitoken: be-lean-and-mean-and-in-between | ||
observationtopics: | ||
- topic: observations/down/tapir-pop | ||
pubkeyname: tapir-analyze-pubkey | ||
- topic: observations/down/tapir-pop/debug | ||
pubkeyname: tapir-mgmt-debug-pubkey | ||
statustopics: | ||
- topic: status/up/axfr/tapir-pop | ||
privkeyname: edge-{EdgeId}-signer-pubkey |
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