Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type API ¶
API ...
type Command ¶
type Command struct {
Ui cli.Ui
ShutdownCh <-chan struct{}
// contains filtered or unexported fields
}
Command ...
type Config ¶
type Config struct {
EncryptorPath string `mapstructure:"encryptor_path"`
DecryptorPath string `mapstructure:"decryptor_path"`
APIAddr string `mapstructure:"api_addr"`
APIPassword string `mapstructure:"api_password"`
LogLevel string `mapstructure:"log_level"`
Protocol int `mapstructure:"protocol"`
DevelopmentMode bool `mapstructure:"development_mode"`
}
Config ...
func ReadConfigPaths ¶
ReadConfigPaths reads the paths in the given order to load configurations.
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
Core ...
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service ...
func (*Service) Decrypt ¶
func (s *Service) Decrypt(r *http.Request, req *model.DecryptRequest, res *model.DecryptResponse) error
Decrypt json rpc2.0 call that parses variables and passes it to Decrypt Plugin. Sample query
jq -n \
--arg source "/tmp/encrypted" \
--arg destination "/tmp/decrypted" \
--arg nonce "e12ffdfa6cb6e56238935e32604cfa5538d3ad51a3542daa" \
--arg key "63b76723eb3f9d4f4862b73ff7e39b93c4de129feb4885f1f3feb74dd456e3a5" \
--arg id "2" \
--arg method "Service.Decrypt" \
'{"jsonrpc": "2.0", "method":$method,"params":{"source": $source, "destination":$destination, "nonce":$nonce, "key":$key},"id": $id}' | curl \
-X POST \
--silent \
--header "Authorization: 12445" \
--header "Content-type: application/json" \
--data @- \
http://127.0.0.1:8081/rpc | jq -r
func (*Service) Encrypt ¶
func (s *Service) Encrypt(r *http.Request, req *model.EncryptRequest, res *model.EncryptResponse) error
Encrypt json rpc2.0 call that pparses variables and passes it to Encrypt Plugin. Sample query
jq -n \
--arg source "/tmp/plain" \
--arg destination "/tmp/encrypted" \
--arg key "63b76723eb3f9d4f4862b73ff7e39b93c4de129feb4885f1f3feb74dd456e3a5" \
--arg id "1" \
--arg method "Service.Encrypt" \
'{"jsonrpc": "2.0", "method":$method,"params":{"source": $source, "destination":$destination,"key":$key},"id": $id}' | curl \
-X POST \
--silent \
--header "Authorization: 12445" \
--header "Content-type: application/json" \
--data @- \
http://127.0.0.1:8081/rpc | jq -r
Click to show internal directories.
Click to hide internal directories.