Skip to content

Commit

Permalink
PMM-13633 Migration of API keys. (#3420)
Browse files Browse the repository at this point in the history
* PMM-13633 Doc for migration of API keys.

* PMM-13633 New check for not service account error.

* PMM-13633 Lint.

* PMM-13633 Handle empty responses in client do.

* PMM-13633 Better naming for target variable.

* PMM-13633 Add warning message on PMM side.

* PMM-13633 Small refactor.

* PMM-13633 Remove sanitize from createSA and from all tokens.

* PMM-13633 Add snooze for API keys migration modal.

* PMM-13633 More changes related to snooze API keys migration.

* Revert "PMM-13633 Remove sanitize from createSA and from all tokens."

This reverts commit f190157.

* PMM-13633 Remove sanitize for creating of Service accounts and keys.

* PMM-13633 curl example.

* PMM-13633 Fix warning in case of invalid token.

* Update documentation/docs/pmm-upgrade/migrating_from_pmm_2.md

Co-authored-by: Alex Demidoff <[email protected]>

* Update managed/services/grafana/client.go

Co-authored-by: Alex Demidoff <[email protected]>

* Update managed/services/grafana/client.go

Co-authored-by: Alex Demidoff <[email protected]>

* Update documentation/docs/pmm-upgrade/migrating_from_pmm_2.md

Co-authored-by: Alex Demidoff <[email protected]>

* linguistic review + troubleshooting info

* Update managed/services/grafana/client.go

Co-authored-by: Alex Demidoff <[email protected]>

* formatting

* mentioned default address and port

* PMM-13633 Changes related to required changes in Grafana PR.

---------

Co-authored-by: Alex Demidoff <[email protected]>
Co-authored-by: Catalina A <[email protected]>
  • Loading branch information
3 people authored Jan 14, 2025
1 parent 07df3de commit d49e6d0
Show file tree
Hide file tree
Showing 19 changed files with 308 additions and 138 deletions.
5 changes: 2 additions & 3 deletions api-tests/server/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (
pmmapitests "github.com/percona/pmm/api-tests"
serverClient "github.com/percona/pmm/api/server/v1/json/client"
server "github.com/percona/pmm/api/server/v1/json/client/server_service"
"github.com/percona/pmm/utils/grafana"
stringsgen "github.com/percona/pmm/utils/strings"
)

Expand Down Expand Up @@ -523,7 +522,7 @@ func createServiceAccountWithRole(t *testing.T, role, nodeName string) int {

name := fmt.Sprintf("%s-%s", pmmServiceAccountName, nodeName)
data, err := json.Marshal(map[string]string{
"name": grafana.SanitizeSAName(name),
"name": name,
"role": role,
})
require.NoError(t, err)
Expand Down Expand Up @@ -585,7 +584,7 @@ func createServiceToken(t *testing.T, serviceAccountID int, nodeName string) (in

name := fmt.Sprintf("%s-%s", pmmServiceTokenName, nodeName)
data, err := json.Marshal(map[string]string{
"name": grafana.SanitizeSAName(name),
"name": name,
})
require.NoError(t, err)

Expand Down
16 changes: 16 additions & 0 deletions api/swagger/swagger-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -28129,6 +28129,11 @@
"type": "string",
"title": "Snoozed PMM version update",
"x-order": 3
},
"snoozed_api_keys_migration": {
"type": "boolean",
"title": "Snoozed warning about API keys migration",
"x-order": 4
}
}
}
Expand Down Expand Up @@ -28198,6 +28203,12 @@
"title": "Snooze update alert for a PMM version",
"x-nullable": true,
"x-order": 2
},
"snoozed_api_keys_migration": {
"type": "boolean",
"title": "Snoozed warning about API keys migration",
"x-nullable": true,
"x-order": 3
}
}
}
Expand Down Expand Up @@ -28229,6 +28240,11 @@
"type": "string",
"title": "Snooze update alert for a PMM version",
"x-order": 3
},
"snoozed_api_keys_migration": {
"type": "boolean",
"title": "Snoozed warning about API keys migration",
"x-order": 4
}
}
}
Expand Down
16 changes: 16 additions & 0 deletions api/swagger/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -27171,6 +27171,11 @@
"type": "string",
"title": "Snoozed PMM version update",
"x-order": 3
},
"snoozed_api_keys_migration": {
"type": "boolean",
"title": "Snoozed warning about API keys migration",
"x-order": 4
}
}
}
Expand Down Expand Up @@ -27240,6 +27245,12 @@
"title": "Snooze update alert for a PMM version",
"x-nullable": true,
"x-order": 2
},
"snoozed_api_keys_migration": {
"type": "boolean",
"title": "Snoozed warning about API keys migration",
"x-nullable": true,
"x-order": 3
}
}
}
Expand Down Expand Up @@ -27271,6 +27282,11 @@
"type": "string",
"title": "Snooze update alert for a PMM version",
"x-order": 3
},
"snoozed_api_keys_migration": {
"type": "boolean",
"title": "Snoozed warning about API keys migration",
"x-order": 4
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions api/user/v1/json/client/user_service/get_user_responses.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions api/user/v1/json/client/user_service/update_user_responses.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions api/user/v1/json/v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@
"type": "string",
"title": "Snoozed PMM version update",
"x-order": 3
},
"snoozed_api_keys_migration": {
"type": "boolean",
"title": "Snoozed warning about API keys migration",
"x-order": 4
}
}
}
Expand Down Expand Up @@ -192,6 +197,12 @@
"title": "Snooze update alert for a PMM version",
"x-nullable": true,
"x-order": 2
},
"snoozed_api_keys_migration": {
"type": "boolean",
"title": "Snoozed warning about API keys migration",
"x-nullable": true,
"x-order": 3
}
}
}
Expand Down Expand Up @@ -223,6 +234,11 @@
"type": "string",
"title": "Snooze update alert for a PMM version",
"x-order": 3
},
"snoozed_api_keys_migration": {
"type": "boolean",
"title": "Snoozed warning about API keys migration",
"x-order": 4
}
}
}
Expand Down
Loading

0 comments on commit d49e6d0

Please sign in to comment.