mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-01 18:33:19 +02:00
authorize: audit logging (#2050)
* authorize: add databroker server and record version to result, force sync via polling * authorize: audit logging
This commit is contained in:
parent
00e56212ec
commit
f4c4fe314a
18 changed files with 1395 additions and 1390 deletions
26
config/crypt.go
Normal file
26
config/crypt.go
Normal file
|
@ -0,0 +1,26 @@
|
|||
package config
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
|
||||
"github.com/pomerium/pomerium/pkg/cryptutil"
|
||||
)
|
||||
|
||||
// A PublicKeyEncryptionKeyOptions represents options for a public key encryption key.
|
||||
type PublicKeyEncryptionKeyOptions struct {
|
||||
ID string `mapstructure:"id" yaml:"id"`
|
||||
Data string `mapstructure:"data" yaml:"data"` // base64-encoded
|
||||
}
|
||||
|
||||
// GetAuditKey gets the audit key from the options. If no audit key is provided it will return (nil, nil).
|
||||
func (o *Options) GetAuditKey() (*cryptutil.PublicKeyEncryptionKey, error) {
|
||||
if o.AuditKey == nil {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
raw, err := base64.StdEncoding.DecodeString(o.AuditKey.Data)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return cryptutil.NewPublicKeyEncryptionKey(o.AuditKey.ID, raw)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue