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

T5743: HTTPS API ability to import PKI certificates #3977

Merged
merged 1 commit into from
Aug 20, 2024

Conversation

natali-rs1985
Copy link
Contributor

@natali-rs1985 natali-rs1985 commented Aug 13, 2024

Change Summary

HTTPS API call to import PKI certificaties
https://vyos/import-pki

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Related PR(s)

Component(s) name

Proposed changes

How to test

To import publik key:

vyos@vyos# curl -k --location --request POST 'https://localhost/import-pki' --form data='{"op": "import-pki", "path": ["pki", "ca", "test", "file", "/config/auth/test.pem"]}' --form key='foo'
{"success": true, "data": "1 value(s) installed.", "error": null}[edit]
vyos@vyos#

To import private key:

vyos@vyos# curl -k --location --request POST 'https://localhost/import-pki' --form data='{"op": "import-pki", "path": ["pki", "ca", "test", "key-file", "/config/auth/test.key"], "passphrase": ""}' --form key='foo'
{"success": true, "data": "1 value(s) installed.", "error": null}[edit]
vyos@vyos#

Smoketest result

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

Copy link

github-actions bot commented Aug 13, 2024

👍
No issues in PR Title / Commit Title

Copy link

✅ No issues found in unused-imports check.. Please refer the workflow run

@sever-sever
Copy link
Member

Use "compare" to see the pending changes, and "commit" to apply.

Will it import the keys or user still need commit it manually?

@natali-rs1985
Copy link
Contributor Author

natali-rs1985 commented Aug 16, 2024

vyos@vyos# curl -k --location --request POST 'https://localhost/import-pki' --form data='{"op": "import-pki", "path": ["pki", "ca", "test", "file", "/config/auth/test.pem"]}' --form key

User doesn't need to commit changes. The key is already impored

{"success": true, "data": "1 value(s) installed", "error": null}[edit]

@c-po c-po merged commit 538930c into vyos:current Aug 20, 2024
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

4 participants