Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
bd25ad9
feat(worker-availability): extend worker table with 4 fields
KellyMerrick Feb 27, 2023
a38c69f
Merge branch 'main' into worker_visibility
KellyMerrick Feb 27, 2023
723e453
fix(main): merge main into branch
KellyMerrick Apr 6, 2023
5483e0f
fix(api-metrics.go): fix merge conflicts
KellyMerrick Apr 6, 2023
fdb8cb8
Merge branch 'worker_visibility' of github.com:go-vela/server into wo…
KellyMerrick Apr 6, 2023
822800a
fix(api-worker.go): clean up merge text
KellyMerrick Apr 6, 2023
98691a5
Merge branch 'main' into worker_visibility
KellyMerrick Apr 12, 2023
540d7d0
fix(api/worker.go): correct closing brace
KellyMerrick Apr 12, 2023
55dba0a
Merge branch 'main' of github.com:go-vela/server into worker_visibility
KellyMerrick Apr 26, 2023
11f5a1e
Merge branch 'main' into worker_visibility
KellyMerrick Apr 26, 2023
e1f128c
feat(metrics.go): update list of worker statuses; merge in main
KellyMerrick May 17, 2023
56f3e25
Merge branch 'worker_visibility' of github.com:go-vela/server into wo…
KellyMerrick May 17, 2023
b9ae9af
feat(metrics.go): add idle_worker_count
KellyMerrick May 18, 2023
49ca50d
feat(worker): modify permissions to all worker for work towards updat…
KellyMerrick May 22, 2023
e5e7c08
fix(runningBuildIDs): allow nil update to list
KellyMerrick May 31, 2023
e8eda6a
feat(worker): update last_status_update_at in the database
KellyMerrick Jun 1, 2023
4d79db4
feat(worker): add LastBuildStartedAt field
KellyMerrick Jun 2, 2023
6073481
fix(worker): allow update of last build started and finished
KellyMerrick Jun 2, 2023
b4f39c4
Merge branch 'main' into worker_visibility
KellyMerrick Jun 2, 2023
3f60d07
Merge branch 'main' of github.com:go-vela/server into worker_visibility
KellyMerrick Jun 2, 2023
2e22e2f
Merge branch 'main' of github.com:go-vela/server into worker_visibility
KellyMerrick Jun 8, 2023
1d36eb7
Merge branch 'main' of github.com:go-vela/server into worker_visibility
KellyMerrick Jun 8, 2023
99541ac
test(worker): ensure all new fields are added to relevant tests
KellyMerrick Jun 8, 2023
b2707d9
Merge branch 'worker_visibility' of github.com:go-vela/server into wo…
KellyMerrick Jun 8, 2023
d3dd14f
Merge branch 'main' of github.com:go-vela/server into worker_visibility
KellyMerrick Jun 12, 2023
a79873a
chore(worker_visibility): pull in types and server main
KellyMerrick Jun 12, 2023
8640cd0
chore(worker_visibility): pull in types and server main
KellyMerrick Jun 14, 2023
c648ab8
addressed feedback
timhuynh94 Jun 14, 2023
999a1db
fix(running_build_ids): correct copy/paste, size should be 500
KellyMerrick Jun 15, 2023
56aea85
fix(running-builds): not requiring a list in body for updates
KellyMerrick Jun 15, 2023
60996b8
Merge branch 'main' into worker_visibility
KellyMerrick Jun 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(worker): modify permissions to all worker for work towards updat…
…ing its status
  • Loading branch information
KellyMerrick committed May 22, 2023
commit 49ca50df4845a9f213a818b8a8e513bd7865bd24
9 changes: 9 additions & 0 deletions router/middleware/perm/perm.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ func MustWorkerAuthToken() gin.HandlerFunc {
"worker": cl.Subject,
}).Debugf("verifying worker %s has a valid auth token", cl.Subject)

// global permissions bypass
if cl.IsAdmin {
logrus.WithFields(logrus.Fields{
"user": cl.Subject,
}).Debugf("user %s has platform admin permissions", cl.Subject)

return
}

switch cl.TokenType {
case constants.WorkerAuthTokenType, constants.WorkerRegisterTokenType:
return
Expand Down
2 changes: 1 addition & 1 deletion router/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func WorkerHandlers(base *gin.RouterGroup) {
_worker := _workers.Group("/:worker")
{
_worker.GET("", wmiddleware.Establish(), worker.GetWorker)
_worker.PUT("", perm.MustPlatformAdmin(), wmiddleware.Establish(), worker.UpdateWorker)
_worker.PUT("", perm.MustPlatformAdmin(), perm.MustWorkerAuthToken(), wmiddleware.Establish(), worker.UpdateWorker)
_worker.POST("/refresh", perm.MustWorkerAuthToken(), wmiddleware.Establish(), worker.Refresh)
_worker.DELETE("", perm.MustPlatformAdmin(), wmiddleware.Establish(), worker.DeleteWorker)
} // end of worker endpoints
Expand Down