Minor refactoring - #5
Merged
Merged
Conversation
ThaminduDilshan
previously approved these changes
May 5, 2025
ThaminduDilshan
approved these changes
May 5, 2025
This file contains hidden or 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
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.
Purpose
This pull request includes a variety of changes aimed at improving code readability, fixing inconsistencies, and removing unused functionality. The most important changes include renaming methods and variables for clarity, replacing shorthand variable declarations with explicit ones, removing unused functions, and handling potential errors in JSON encoding.
Code readability improvements:
initMultiPlexertoinitMultiplexerto fix a typo and ensure consistency in naming throughout the codebase. (cmd/server/main.go) [1] [2]startServerto improve clarity by changing "Starting Asgardeo Thunder..." to "Asgardeo Thunder started...". (cmd/server/main.go)internal/application/service/applicationservice.go,internal/identity/oauth2/token/tokenhandler.go) [1] [2]Code simplification:
redirectURIs := []string{}) with explicit declarations (e.g.,var redirectURIs []string) for better readability. (internal/application/service/applicationservice.go,internal/system/database/client/dbclient.go) [1] [2] [3]Removal of unused functionality:
IsValidRedirectURIfunction, which checked the validity of redirect URIs for OAuth applications. (internal/application/utils/utils.go)Error handling:
WriteJSONErrorto ensure the function exits gracefully if encoding fails. (internal/utils/httputil.go)Documentation updates:
ServiceInterfacestruct to clarify its purpose in handling routes. (internal/services/service.go)