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

Add support for account alias and account id in console federation #61

Merged

Conversation

bshutterkion
Copy link
Collaborator

@bshutterkion bshutterkion commented Sep 13, 2024

Added

  • New alias support for account selection in the kion console command, allowing users to specify an account alias.
  • New account support for account selection in the kion console command, allowing users to specify an account number.
  • Validation in kion console to ensure correct flag combinations are passed (--account or --alias must be used with --car).

Changed

  • Refactored CAR retrieval to handle account numbers and aliases within fedConsole and related helper functions.
  • Documentation was updated to include usage examples for account aliases in kion stak and kion console.
  • Documentation was updated to include usage examples for account numbers in kion console.
  • Documentation was updated with notes about alias functionality requiring Kion versions 3.9.9 and 3.10.2 and up.

Fixed

  • Corrected formatting in README's curl command example for setting the destination URL.
  • Corrected JSON content type in cURL examples.

…l commands

- Modified the `GetFederationURL` function to accept an `accountAlias` parameter.
- Enhanced the `fedConsole` function to allow fetching CAR details using both `accountAlias` and `carName` directly.
- Added new CLI flags (`alias`, `car`) to the federation console command for improved usability.
…ole commands

- Enhanced the `GetFederationURL` function in `console.go` to accept an `accountAlias` parameter.
- Updated the README.md to include instructions and notes regarding account alias support for Kion versions 3.9.9, 3.10.2, and above.
- Clarified alias usage in the console commands, including both sub-shell and federation options.
- Modified CLI flag descriptions in `main.go` to specify that `alias` must be used in conjunction with `car`.
- Updated README.md with consistent usage of "NOTE" format for clarity
- Added missing documentation for the console command options
- Removed `AccountAlias` field from `URLRequest` struct in console.go
- Refactored `GetFederationURL` function to remove unused `accountAlias` parameter
- Fixed inconsistent capitalization of "Kion" and "CSP" across codebase
- Minor improvements to comment formatting and corrected usage descriptions in main.go
- Added `validateCmdConsole` function to ensure proper flag combinations for the console command.
  - Enforces that the `--car` flag must be passed with either `--account` or `--alias`.
  - Throws an error if `--account` or `--alias` is used without `--car`.
- Modified `fedConsole` to handle cases where either `--account` or `--alias` can be used with `--car`.
  - Added logic to fetch CAR by account number or alias.
- Introduced `--account` flag alongside `--car` and `--alias` in the console command.
…account number

- Added documentation for the `--account` option in the `kion console` command to allow federating into a web console using an account number.
- Updated the OPTIONS section to include details for the `--account` flag, which bypasses prompts when used with `--car`.
@bshutterkion bshutterkion changed the title Add support for account alias in console federation Add support for account alias and account id in console federation Sep 13, 2024
- Updated the README.md to fix a note formatting regarding Firefox pop-up approval.
- Removed unnecessary file-level comments from main.go to improve code clarity.
…nt number

- Introduced `Alias` field to `kion.Account` and `kion.CAR` structs.
- Updated tests to reflect the new `Alias` field in account and CAR mappings.
- Added `FindCARByNameAndAccountNumber` and `FindCARByNameAndAlias` helper functions to search CARs using account number and alias respectively.
- Enhanced test coverage for the new helper functions with various edge cases (finding CARs by account number and alias).
…est.go

The border of the comment block in `helper_test.go` was adjusted to remove extra characters for consistency and formatting purposes.
…ccount ID

Removed unneeded comments in transform_test.go
…d helper functions

- Updated README to clarify that account alias is only supported in Kion versions 3.9.9, 3.10.2, and later.
- Removed unneeded helper functions `FindCARByNameAndAccountNumber` and `FindCARByNameAndAlias` from `helper_test.go` and `transform_test.go`, along with their corresponding test cases.
@bshutterkion bshutterkion merged commit 47e0e2e into main Sep 17, 2024
2 checks passed
@bshutterkion bshutterkion deleted the feat(console)-add-account-alias-support-to-console-commands branch September 17, 2024 19:44
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