fix: JWT Profile (#748)

* fix: correct env var for tracing type

* fix: local env tracing

* fix: key in detail as string

* fix: implement storage

* fix: machine key by id
fix: store public key as bytes instead of crypto value

* update oidc pkg

* dont check origins for service account tokens

* fix: scopes

* fix: dependencies

* fix: dependencies

* fix: remove unused code

* fix: variable naming

Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
Silvan
2020-09-17 08:49:33 +02:00
committed by GitHub
parent 71abc4f077
commit 5a8cafcae5
19 changed files with 335 additions and 88 deletions

View File

@@ -69,10 +69,10 @@ func MachineToModel(machine *Machine) *model.Machine {
type MachineKey struct {
es_models.ObjectRoot `json:"-"`
KeyID string `json:"keyId,omitempty"`
Type int32 `json:"type,omitempty"`
ExpirationDate time.Time `json:"expirationDate,omitempty"`
PublicKey *crypto.CryptoValue `json:"publicKey,omitempty"`
KeyID string `json:"keyId,omitempty"`
Type int32 `json:"type,omitempty"`
ExpirationDate time.Time `json:"expirationDate,omitempty"`
PublicKey []byte `json:"publicKey,omitempty"`
privateKey []byte
}
@@ -117,11 +117,7 @@ func (key *MachineKey) GenerateMachineKeyPair(keySize int, alg crypto.Encryption
if err != nil {
return err
}
publicKeyBytes, err := crypto.PublicKeyToBytes(publicKey)
if err != nil {
return err
}
key.PublicKey, err = crypto.Encrypt(publicKeyBytes, alg)
key.PublicKey, err = crypto.PublicKeyToBytes(publicKey)
if err != nil {
return err
}