-
Notifications
You must be signed in to change notification settings - Fork 209
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
Update API Token from the UI #2198
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declaring remote flag in cli pro command for enabling update token via Odigos ui --------- Co-authored-by: Ben Elferink <ben.elferink@icloud.com>
BenElferink
changed the title
feat: cli remote update token
Update API Token from the UI
Jan 12, 2025
This pull request includes several changes to the `cli` and `frontend` components of the project. The modifications primarily focus on updating API tokens and restructuring the GraphQL schema and resolver methods. ### CLI Changes: * **Import Order Fixes:** Reordered imports in `cli/cmd/pro.go` to follow the standard convention. * **Function Signature Update:** Modified the `executeRemoteUpdateToken` function to include an additional `onPremToken` parameter. [[1]](diffhunk://#diff-433dfb4fa2ecc9c2fe6e9a0996b24b5c205837c86b9201767e7f4956e98b41a5L36-R37) [[2]](diffhunk://#diff-433dfb4fa2ecc9c2fe6e9a0996b24b5c205837c86b9201767e7f4956e98b41a5L52-R54) ### Frontend Changes: * **GraphQL Schema Updates:** * Added `UpdateAPIToken` complexity function to the `ComplexityRoot` struct. * Introduced `UpdateAPIToken` method in the `MutationResolver` interface. * **GraphQL Resolver Methods:** * Implemented `UpdateAPIToken` resolver method and its associated context and arguments handling. [[1]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2R1677-R1688) [[2]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2R2832-R2846) [[3]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2L9733-R9763) [[4]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2L9747-R9776) [[5]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2L9759-R9800) [[6]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2L9797-R9810) [[7]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2L9914-R9928) * Reverted changes to the `TestConnectionForDestination` resolver method and restored it to its original position. [[1]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2R10179-R10245) [[2]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2L20246-R20332) These changes aim to enhance the functionality and maintainability of the codebase by improving token management and ensuring consistency in GraphQL operations.
BenElferink
requested review from
alonkeyval and
blumamir
and removed request for
alonkeyval
January 12, 2025 15:25
blumamir
approved these changes
Jan 13, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes multiple changes aimed at improving code maintainability and functionality across several files. The most significant changes involve adding a new
lint-fix
target to theMakefile
, refactoring thecli/cmd/describe.go
file to use constants, and updating thefrontend/graph/generated.go
file to include a new mutation for updating API tokens.Makefile improvements:
lint-fix
target to theMakefile
to allow automatic fixing of linting issues for thecommon
andk8sutils
modules.CLI command refactoring:
cli/cmd/describe.go
to use constants fromk8sconsts
for service names and ports, improving code readability and maintainability. [1] [2] [3] [4]cli/cmd/pro.go
to include a new flagupdateRemoteFlag
and refactored the token update logic to use a remote update function if the flag is set. [1] [2]Frontend GraphQL schema updates:
UpdateAPIToken
to the GraphQL schema infrontend/graph/generated.go
, allowing API tokens to be updated. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]Miscellaneous updates:
cli/cmd/resources/ui.go
to use constants fromk8sconsts
for service names and ports, ensuring consistency across the codebase. [1] [2]