Skip to content

Comments

OPS-1485: Add more credential type support#14

Merged
thedevelopnik merged 12 commits intomainfrom
OPS-1485
Dec 29, 2025
Merged

OPS-1485: Add more credential type support#14
thedevelopnik merged 12 commits intomainfrom
OPS-1485

Conversation

@thedevelopnik
Copy link
Collaborator

@thedevelopnik thedevelopnik commented Dec 11, 2025

Related Issue / Ticket

Ref: https://aembit.atlassian.net/browse/OPS-1485

Summary

This PR adds support for multiple credential types beyond the initial API Key implementation, including Username/Password, OAuth tokens, Google Workload Identity Federation, and AWS STS Federation credentials.

Changes

Build & Infrastructure:

  • Reorganized OpenAPI spec location and code generation output directory
  • Added @kubb/plugin-client for API client generation
  • Updated TypeScript configuration to support new directory structure
  • Fixed build process to correctly compile and bundle with new structure

Features:

  • Created new credential.ts module supporting 5 credential types: ApiKey, UsernamePassword, OAuthToken, GoogleWorkloadIdentityFederation, AwsStsFederation
  • Added validateServerPort function with proper validation
  • Refactored credential fetching to use generated API client types
  • Removed deprecated api-key.ts module

Testing:

  • Added comprehensive test coverage for new credential module
  • Updated all tests to use new credential module and generated types
  • Removed deprecated api-key tests

Documentation:

  • Updated README with detailed output documentation for all credential types
  • Added usage examples for each credential type

Security Considerations

This change handles multiple types of sensitive credentials (passwords, tokens, access keys). All credential outputs are properly masked using core.setSecret() before being set as Action outputs. No changes to input
sanitization or dependency versions.

Checklist

  • I have commented my code, particularly in hard-to-understand areas.
  • Documentation: I have made corresponding changes to the documentation (README.md, action.yml, etc.).
  • Security: I have verified to the best of my ability that this change introduces no new security vulnerabilities.
  • Build: I have run $ yarn build before my final commit to have an up-to-date distribution of the Action.

- Move edge-api.yaml from __test__/resources to resources/
- Update kubb config to output generated code to gen/ instead of __test__/gen/
- Adjust tsconfig.json rootDir
- Update vitest coverage exclusions for new gen/ directory
- Add @kubb/plugin-client dependency
- Configure client generation in kubb.config.ts with fetch client
- Rename npm script from test:generate to generate
- Generate new API client code from OpenAPI spec
Add support for:
- UsernamePassword
- OAuthToken
- GoogleWorkloadIdentityFederation
- AwsStsFederation

Changes:
- Create new credential.ts module with getCredential and setOutputs functions
- Refactor main.ts to use new credential module instead of api-key module
- Update validate.ts to use generated credential type enums
- Add validateServerPort function with proper number validation
- Add comprehensive credential.test.ts for new credential module
- Update main.test.ts to mock credential module instead of api-key
- Update all test imports to use new generated types location
- Add server port validation tests
- Update test mocks to handle multiple credential types
- Remove old api-key.test.ts as it's been replaced by credential.test.ts
@thedevelopnik thedevelopnik self-assigned this Dec 11, 2025
thedevelopnik and others added 3 commits December 12, 2025 10:38
* (feat): GitHub markdowns to emphasize critical information

* (feat): flag to trim whitespace.

* (lint): linting...
@thedevelopnik thedevelopnik marked this pull request as ready for review December 29, 2025 18:46
@thedevelopnik thedevelopnik requested a review from a team December 29, 2025 18:46
@thedevelopnik
Copy link
Collaborator Author

Taking this out of draft, as it's fully gone through QA.

Question for @apujari-aembit and @m43kwon : do we want to take out the "alpha release" note now that it's gone through all QA steps? I'm pretty confident in it now. But I'm ok leaving it there until we've done more Aembit-on-Aembit work.

@thedevelopnik thedevelopnik merged commit fc24e5f into main Dec 29, 2025
4 checks passed
@thedevelopnik thedevelopnik deleted the OPS-1485 branch December 29, 2025 20:28
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