-
Notifications
You must be signed in to change notification settings - Fork 124
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
PMM-13315 Service account max length. #3221
base: v3
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v3 #3221 +/- ##
==========================================
+ Coverage 44.59% 44.63% +0.04%
==========================================
Files 357 358 +1
Lines 35719 35729 +10
==========================================
+ Hits 15929 15949 +20
+ Misses 18167 18155 -12
- Partials 1623 1625 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
This reverts commit d812c2a.
@@ -617,3 +620,11 @@ func deleteServiceToken(t *testing.T, serviceAccountID, serviceTokenID int) { | |||
|
|||
require.Equalf(t, http.StatusOK, resp.StatusCode, "failed to delete service token, status code: %d, response: %s", resp.StatusCode, b) | |||
} | |||
|
|||
func sanitizeSAName(name string) string { |
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.
I wonder if we can't keep and then import this method from github.com/percona/pmm/managed/utils/strings
package?
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.
It is to avoid dependencies between managed and API tests. To keep them separate. We doing this in more places. It was discussed with Nurlan.
// on orgID number. Let's reserve 10 chars. It will cover almost one million orgIDs. | ||
// Sanitizing, ensure its length by hashing postfix when length is exceeded. | ||
// MD5 is used because it has fixed length 32 chars. | ||
func sanitizeSAName(name string) string { |
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.
Isn't that a utility method?
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.
Not sure if it belongs to utils when its related only to service accounts, which are part of Grafana.
PMM-13315
Percona-Lab/pmm-submodules#3722