-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* created handleling for grpc client to have token based auth only in NG * added pull_request_template to consolidate with templates repo * added .env file * added library to read .env file if they exist * reformatted .env * added env variable to inject token * added error handler when nodeguard token is not set * improved readability of monitoring liquidation rules * removed restriction about NODEGUARD_TOKEN is set * removing internal pr template
- Loading branch information
Showing
8 changed files
with
82 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
LNDCONNECTURIS=lndconnect://127.0.0.1:10003?cert=MIICJTCCAcygAwIBAgIQLYfp6m1vP9wFBXOcE-UsaDAKBggqhkjOPQQDAjAxMR8wHQYDVQQKExZsbmQgYXV0b2dlbmVyYXRlZCBjZXJ0MQ4wDAYDVQQDEwVjYXJvbDAeFw0yMzAzMjkxNTM4MjBaFw0yNDA1MjMxNTM4MjBaMDExHzAdBgNVBAoTFmxuZCBhdXRvZ2VuZXJhdGVkIGNlcnQxDjAMBgNVBAMTBWNhcm9sMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEcXT4dekJnAiZWd8Pk3FgL1BSFXMRwLGSAlk7Di5hIJnIA1B_o8RWKzlPz7u3Aw5mmWHhN8B2MWMylWlWB2130KOBxTCBwjAOBgNVHQ8BAf8EBAMCAqQwEwYDVR0lBAwwCgYIKwYBBQUHAwEwDwYDVR0TAQH_BAUwAwEB_zAdBgNVHQ4EFgQUDOS-19_0LFGf62WRyaaUSLc3j98wawYDVR0RBGQwYoIFY2Fyb2yCCWxvY2FsaG9zdIIFY2Fyb2yCDnBvbGFyLW4xLWNhcm9sggR1bml4ggp1bml4cGFja2V0ggdidWZjb25uhwR_AAABhxAAAAAAAAAAAAAAAAAAAAABhwSsFQAFMAoGCCqGSM49BAMCA0cA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WTBkzovapwkv43lMFAGvD3EUYjapn9UN63LOamwSW67S2p4fyDbZykRVi5KdGuHWqOCAWMwggFfMA4GA1UdDwEB_wQEAwICpDATBgNVHSUEDDAKBggrBgEFBQcDATAPBgNVHRMBAf8EBTADAQH_MB0GA1UdDgQWBBQ_C-VsxCCp7hIukcSQY66T_1-wwDCCAQYGA1UdEQSB_jCB-4INRG9vbW1hYy5sb2NhbIIJbG9jYWxob3N0ggR1bml4ggp1bml4cGFja2V0ggdidWZjb25uhwR_AAABhxAAAAAAAAAAAAAAAAAAAAABhxD-gAAAAAAAAAAAAAAAAAABhxD-gAAAAAAAAFSCWv_--hJchxD-gAAAAAAAAFSCWv_--hJahxD-gAAAAAAAAFSCWv_--hJbhxD-gAAAAAAAAAAtb1hMXkTshwTAqAHlhxD-gAAAAAAAAHQf-P_-JUMfhwQKkK07hxD-gAAAAAAAANx-KvMiB6mphxD-gAAAAAAAAIdaqQYVUHbchxD-gAAAAAAAAM6BCxy9LAaeMAoGCCqGSM49BAMCA0gAMEUCIHmOfHbewxWmX0JoItg8vF84A3GWfYLvjbnGxoapsaH4AiEAlGk3QVSDSHjP7vntLEK37tJ3ZCZAYeuLJKYSjbgbdI8&macaroon=AgEEbG9vcAJ3AwoQSQHLuEtbfDxGeNmwvABdRRIBMBoMCgRhdXRoEgRyZWFkGg8KBGxvb3ASAmluEgNvdXQaGgoLc3VnZ2VzdGlvbnMSBHJlYWQSBXdyaXRlGhUKBHN3YXASB2V4ZWN1dGUSBHJlYWQaDQoFdGVybXMSBHJlYWQAAAYgHb_8HcZwROzXASOxItpkbD3XAWHy1Ye32vlc1ccLeg8 | ||
OTEL_RESOURCE_ATTRIBUTES=service.name=liquidator,service.version=0.1.0 | ||
OTEL_EXPORTER_OTLP_ENDPOINT=host.docker.internal:4317 |
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,2 +1,4 @@ | ||
liquidator | ||
regtest.polar/ | ||
.loop | ||
.idea |
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 |
---|---|---|
|
@@ -22,6 +22,7 @@ THE SOFTWARE. | |
package main | ||
|
||
import ( | ||
_ "github.com/joho/godotenv/autoload" | ||
"time" | ||
) | ||
|
||
|
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,22 @@ | ||
package rpc | ||
|
||
import "context" | ||
|
||
type TokenAuth struct { | ||
Token string | ||
HeaderName string | ||
} | ||
|
||
func NewTokenAuth(token string, header string) *TokenAuth { | ||
return &TokenAuth{Token: token, HeaderName: header} | ||
} | ||
|
||
func (ta *TokenAuth) GetRequestMetadata(context.Context, ...string) (map[string]string, error) { | ||
return map[string]string{ | ||
ta.HeaderName: ta.Token, | ||
}, nil | ||
} | ||
|
||
func (ta *TokenAuth) RequireTransportSecurity() bool { | ||
return false | ||
} |
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