Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: handle binary files in file injectors #1151

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

mkanoor
Copy link
Contributor

@mkanoor mkanoor commented Nov 22, 2024

For Kerberos we need to support a keytab file which is a binary file and its used for service accounts during authentication with Kerberos.

This uses the format: binary_base64 in the field definition to let the UI know that the expected file is supposed to be binary and needs to be sent up as base64
You can create a credential type with the following schema

Inputs configuration

fields:
  - id: keytab
    type: string
    label: Kerberos Keytab file
    format: binary_base64
    secret: true
    help_text: Please select a Kerberos Keytab file
    multiline: true

Injector Configuration

file:
  template.keytab_file: '{{ keytab }}'

No changes are needed to ansible-rulebook it already handles binary files.

https://issues.redhat.com/browse/AAP-25518

@mkanoor mkanoor requested a review from a team as a code owner November 22, 2024 19:40
@mkanoor mkanoor changed the title feat: handle binary files feat: handle binary files in file injectors Nov 22, 2024
src/aap_eda/wsapi/consumers.py Show resolved Hide resolved
src/aap_eda/wsapi/consumers.py Outdated Show resolved Hide resolved
@hsong-rh
Copy link
Contributor

@mkanoor are you going to add pytests for function extract_variables?

For Kerberos we need to support a keytab file which is a binary
file and its used for service accounts during authentication
with Kerberos.

This uses the format: binary_base64 in the field definition to
let the UI know that the expected file is supposed to be binary
and needs to be sent up as base64
You can create a credential with the following schema

Inputs configuration

```
fields:
  - id: keytab
    type: string
    label: Kerberos Keytab file
    format: binary_base64
    secret: true
    help_text: Please select a Kerberos Keytab file
    multiline: true
```

Injector Configuration

```
file:
  template.keytab_file: '{{ keytab }}'
```

No changes are needed to ansible-rulebook it already handles
binary files.

https://issues.redhat.com/browse/AAP-25518
@mkanoor mkanoor merged commit a1b2c76 into ansible:bugfix/injectors Nov 25, 2024
7 checks passed
bzwei pushed a commit to bzwei/eda-server that referenced this pull request Dec 6, 2024
bzwei pushed a commit to bzwei/eda-server that referenced this pull request Dec 6, 2024
bzwei pushed a commit to bzwei/eda-server that referenced this pull request Dec 6, 2024
Alex-Izquierdo pushed a commit to Alex-Izquierdo/eda-server that referenced this pull request Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants