-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Create db and kube web handlers #6672
Conversation
b8afe5e
to
fc932db
Compare
lib/web/apiserver.go
Outdated
@@ -305,6 +305,12 @@ func NewHandler(cfg Config, opts ...HandlerOption) (*RewritingHandler, error) { | |||
// web context | |||
h.GET("/webapi/sites/:site/context", h.WithClusterAuth(h.getUserContext)) | |||
|
|||
// Database access handlers. | |||
h.GET("/webapi/sites/:site/databases", h.WithClusterAuth(h.siteDatabasesGet)) |
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.
"site" is obsolete terminology - ok to keep it in handler paths but let's name functions clusterDatabasesGet
and clusterKubesGet
.
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.
renamed
lib/web/ui/server.go
Outdated
Desc string `json:"desc"` | ||
// Procotol is the database description. | ||
Procotol string `json:"protocol"` | ||
// Type is the database type, self-hosted or AWS RDS. |
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.
Nit: Instead of "or AWS RDS" I would just say "or cloud-hosted" which would cover RDS, Redshift, Cloud SQL and anything we'll add in future.
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.
revised
lib/web/ui/usercontext.go
Outdated
@@ -66,6 +67,10 @@ type userACL struct { | |||
Nodes access `json:"nodes"` | |||
// AppServers defines access to application servers | |||
AppServers access `json:"appServers"` | |||
// DbServers defines access to database servers. | |||
DbServers access `json:"dbServers"` |
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.
Nit: DBServers
for consistency with how it's capitalized in other places.
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.
renamed
f9753d9
to
099fd45
Compare
|
||
// MakeKubes creates ui kube objects and returns a list.. | ||
func MakeKubes(clusterName string, servers []types.Server) []Kube { | ||
uiKubeClusters := []Kube{} |
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.
uiKubeClusters := []Kube{} | |
uiKubeClusters := make([]Kube, 0, len(servers)) |
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 didn't make this change, b/c the len is determine by how many kube clusters there are in each server
lib/web/ui/server.go
Outdated
|
||
// MakeDatabases creates server database objects. | ||
func MakeDatabases(clusterName string, servers []types.DatabaseServer) []Database { | ||
uiServers := []Database{} |
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.
uiServers := []Database{} | |
uiServers := make([]Database, 0, len(servers)) |
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.
revised
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.
Bot.
- rename handler name prefix "site" to "cluster" - rename DbServers to DBServers - removed URI field b/c it is not needed in front - update test
0deff3c
to
a3e9b25
Compare
…#6754) * Create GET db and kube list web handlers (#6672) * Check cloud feature before setting billing access for web (#6537) - Init web handler with auth server feature flags on proxy init - Retrieve auth server features by calling Ping when connecting to auth svc which contains the server feature flags in the response
part of #6466
part of #5086
Description