Coder Social home page Coder Social logo

plugin-crypto's People

Contributors

anna-geller avatar dependabot[bot] avatar fhussonnois avatar loicmathieu avatar skraye avatar tchiotludo avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

skraye

plugin-crypto's Issues

recipients properties of openpgp.encrypt task is not dynamic

Expected Behavior

As documented here the openpgp.encrypt#recipients properties should be dynamic.
But when we try somethings like this:

recipients:
      - "{{ namespace.recipient }}"

the {{ }} part is not evaluated

Actual Behaviour

No response

Steps To Reproduce

No response

Environment Information

  • Kestra Version: 0.8.1
  • Plugin version: 0.8
  • Operating System (OS / Docker / Kubernetes): Kubernetes
  • Java Version (If not docker):

Example flow

No response

Openpgp Encrypt task errors out

Expected Behavior

Openpgp encrypttask should successfully encrypt the provided file.

Actual Behaviour

  1. Flow Example 1:
id: "encrypt"
type: "io.kestra.plugin.crypto.openpgp.Encrypt"
from: "{{ inputs.file }}"
key: |
  -----BEGIN PGP PUBLIC KEY BLOCK----- ... 
recipients:
  - <my_email_address>

The task errors out with the following error:

2024-02-17 17:10:44.458No (suitable) public key for encryption to <my_email_address> found
2024-02-17 17:10:44.458org.bouncycastle.openpgp.PGPException: No (suitable) public key for encryption to <my_email_address> found
	at name.neuhalfen.projects.crypto.bouncycastle.openpgp.BuildEncryptionOutputStreamAPI$WithAlgorithmSuiteImpl$ToImpl.extractValidKey(BuildEncryptionOutputStreamAPI.java:414)
	at name.neuhalfen.projects.crypto.bouncycastle.openpgp.BuildEncryptionOutputStreamAPI$WithAlgorithmSuiteImpl$ToImpl.toRecipients(BuildEncryptionOutputStreamAPI.java:441)
	at io.kestra.plugin.crypto.openpgp.Encrypt.run(Encrypt.java:144)
	at io.kestra.plugin.crypto.openpgp.Encrypt.run(Encrypt.java:26)
	at io.kestra.core.runners.Worker$WorkerThread.run(Worker.java:729)
  1. Tried the second flow example:
id: "encrypt"
type: "io.kestra.plugin.crypto.openpgp.Encrypt"
from: "{{ inputs.file }}"
key: |
  -----BEGIN PGP PUBLIC KEY BLOCK----- ... 
recipients:
  - <my_email_address>
signPublicKey: |
  -----BEGIN PGP PUBLIC KEY BLOCK----- ... 
signPrivateKey: |
  -----BEGIN PGP PRIVATE KEY BLOCK-----
signPassphrase: my-passphrase
signUser: [email protected]

I get the following error:

2024-02-17 17:11:08.836 Collection already contains a key with a keyID for the passed in ring.
2024-02-17 17:11:08.836 java.lang.IllegalArgumentException: Collection already contains a key with a keyID for the passed in ring.
	at org.bouncycastle.openpgp.PGPPublicKeyRingCollection.addPublicKeyRing(Unknown Source)
	at name.neuhalfen.projects.crypto.bouncycastle.openpgp.keys.keyrings.InMemoryKeyring.addPublicKeyRing(InMemoryKeyring.java:139)
	at name.neuhalfen.projects.crypto.bouncycastle.openpgp.keys.keyrings.InMemoryKeyring.addPublicKey(InMemoryKeyring.java:70)
	at io.kestra.plugin.crypto.openpgp.Encrypt.run(Encrypt.java:126)
	at io.kestra.plugin.crypto.openpgp.Encrypt.run(Encrypt.java:26)
	at io.kestra.core.runners.Worker$WorkerThread.run(Worker.java:729)

Note: I have used the public and private keys as generated on this website: https://webencrypt.org/openpgpjs/

Steps To Reproduce

  1. Flow Example 1:
id: "encrypt"
type: "io.kestra.plugin.crypto.openpgp.Encrypt"
from: "{{ inputs.file }}"
key: |
  -----BEGIN PGP PUBLIC KEY BLOCK----- ... 
recipients:
  - <my_email_address>
  1. Flow example 2:
id: "encrypt"
type: "io.kestra.plugin.crypto.openpgp.Encrypt"
from: "{{ inputs.file }}"
key: |
  -----BEGIN PGP PUBLIC KEY BLOCK----- ... 
recipients:
  - <my_email_address>
signPublicKey: |
  -----BEGIN PGP PUBLIC KEY BLOCK----- ... 
signPrivateKey: |
  -----BEGIN PGP PRIVATE KEY BLOCK-----
signPassphrase: my-passphrase
signUser: [email protected]

Note: I have used the public and private keys as generated on this website: https://webencrypt.org/openpgpjs/

Environment Information

  • Kestra Version: 0.14.4
  • Plugin version: 0.14.4
  • Operating System (OS / Docker / Kubernetes): Docker
  • Java Version (If not docker): N/A

Example flow

Provided above

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.