-
Notifications
You must be signed in to change notification settings - Fork 554
External links extention for app level #2573
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
Conversation
|
| GitGuardian id | Secret | Commit | Filename | |
|---|---|---|---|---|
| 141558 | Generic High Entropy Secret | 2693b86 | scripts/devtron-reference-helm-charts/reference-chart_4-16-0/env-values.yaml | View secret |
| 2763127 | Generic High Entropy Secret | 2693b86 | scripts/devtron-reference-helm-charts/reference-chart_4-16-0/secrets-test-values.yaml | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Our GitHub checks need improvements? Share your feedbacks!
| token := r.Header.Get("token") | ||
| if v.Has("appId") { | ||
| id, err := strconv.Atoi(appId) | ||
| if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
err is not logged
| } | ||
| } | ||
| id, err := strconv.Atoi(clusterId) | ||
| if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error is not logged and handled properly
| return | ||
| } | ||
| } | ||
| id, err := strconv.Atoi(clusterId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactor id field correctly
| ClusterId: 0, | ||
| } | ||
| res, err := impl.externalLinkService.FetchAllActiveLinksByLinkIdentifier(linkIdentifier, id, externalLink.ADMIN_ROLE, int(userId)) | ||
| if err != nil && err != pg.ErrNoRows { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this error should not get propagated here, it should have been handled in dbLayer.
| linkId, err := strconv.Atoi(id) | ||
| if err != nil { | ||
| impl.logger.Errorw("request err, DeleteExternalLink", "err", err, "id", id) | ||
| impl.logger.Errorw("request err, DeleteExternalLink", "id", id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we not logging error here??
| func (impl AppListingRepositoryImpl) FetchAllActiveDevtronAppsWithAppIdAndName() ([]AppNameTypeIdContainerDBResponse, error) { | ||
| impl.Logger.Debug("reached at Fetch All Active Devtron Apps With AppId And Name:") | ||
| var apps []AppNameTypeIdContainerDBResponse | ||
| query := "select id,app_name " + "from app where app_store=false and active=true;" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
convert this query to ORM query.
| var apps []AppNameTypeIdContainerDBResponse | ||
| query := "select installed_apps.id,app.app_name " + "from app INNER JOIN installed_apps on app.id = installed_apps.app_id where app.active=true;" | ||
| _, err := impl.dbConnection.Query(&apps, query) | ||
| if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noRows error handling missing
| var apps []AppNameTypeIdContainerDBResponse | ||
| query := "select id,app_name " + "from app where app_store=false and active=true;" | ||
| _, err := impl.dbConnection.Query(&apps, query) | ||
| if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no rows error handling missing
|
|
||
| func (impl ExternalLinkIdentifierMappingRepositoryImpl) UpdateAllActiveToInActive(Id int, tx *pg.Tx) error { | ||
|
|
||
| query := "UPDATE external_link_identifier_mapping " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace this with ORM query
| } | ||
| return records, nil | ||
| } | ||
| func (impl ExternalLinkServiceImpl) FetchAllActiveLinksByLinkIdentifier(linkIdentifier *LinkIdentifier, clusterId int, userRole string, userId int) ([]*ExternalLinkDto, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
userRole and userId are not used, we need to clean this
| Type: -1, | ||
| ClusterId: 0, | ||
| }) | ||
| expectedResultLinks := make([]externalLink.ExternalLinkDto, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expectedResultLinks should be made using mockLinks or mockGlobLinks
Description
External links can now be configured at cluster level and app level.
Fixes #1991
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: