-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up server-level configuration for OpenSanctions provider.
- Loading branch information
Showing
8 changed files
with
72 additions
and
14 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 |
---|---|---|
|
@@ -77,6 +77,7 @@ CONVOY_API_URL= | |
CONVOY_API_KEY= | ||
CONVOY_PROJECT_ID= | ||
|
||
<<<<<<< HEAD | ||
# | ||
# TUNING | ||
# | ||
|
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,35 @@ | ||
package infra | ||
|
||
const ( | ||
OPEN_SANCTIONS_API_HOST = "https://api.opensanctions.org" | ||
) | ||
|
||
type OpenSanctions struct { | ||
host string | ||
// TODO: this is only for SaaS OpenSanctions API, we may need to abstract | ||
// over authentication to at least offer Basic and Bearer for self-hosted. | ||
apiKey string | ||
} | ||
|
||
func InitializeOpenSanctions(host, apiKey string) OpenSanctions { | ||
return OpenSanctions{ | ||
host: host, | ||
apiKey: apiKey, | ||
} | ||
} | ||
|
||
func (os OpenSanctions) IsSelfHosted() bool { | ||
return len(os.host) > 0 | ||
} | ||
|
||
func (os OpenSanctions) Host() string { | ||
if os.IsSelfHosted() { | ||
return os.host | ||
} | ||
|
||
return OPEN_SANCTIONS_API_HOST | ||
} | ||
|
||
func (os OpenSanctions) ApiKey() string { | ||
return os.apiKey | ||
} |
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
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