@@ -35,6 +35,12 @@ func GetRegistrationToken(ctx *context.APIContext, ownerID, repoID int64) {
3535 ctx .JSON (http .StatusOK , RegistrationToken {Token : token .Token })
3636}
3737
38+ // List Runners for api route validated ownerID and repoID
39+ // ownerID == 0 and repoID == 0 means all runners including global runners, does not appear in sql where clause
40+ // ownerID == 0 and repoID != 0 means all runners for the given repo
41+ // ownerID != 0 and repoID == 0 means all runners for the given user/org
42+ // ownerID != 0 and repoID != 0 undefined behavior
43+ // Access rights are checked at the API route level
3844func ListRunners (ctx * context.APIContext , ownerID , repoID int64 ) {
3945 runners , total , err := db .FindAndCount [actions_model.ActionRunner ](ctx , & actions_model.FindRunnerOptions {
4046 OwnerID : ownerID ,
@@ -57,6 +63,12 @@ func ListRunners(ctx *context.APIContext, ownerID, repoID int64) {
5763 ctx .JSON (http .StatusOK , & res )
5864}
5965
66+ // Get Runners for api route validated ownerID and repoID
67+ // ownerID == 0 and repoID == 0 means any runner including global runners
68+ // ownerID == 0 and repoID != 0 means any runner for the given repo
69+ // ownerID != 0 and repoID == 0 means any runner for the given user/org
70+ // ownerID != 0 and repoID != 0 undefined behavior
71+ // Access rights are checked at the API route level
6072func GetRunner (ctx * context.APIContext , ownerID , repoID , runnerID int64 ) {
6173 runner , err := actions_model .GetRunnerByID (ctx , runnerID )
6274 if err != nil {
@@ -70,6 +82,12 @@ func GetRunner(ctx *context.APIContext, ownerID, repoID, runnerID int64) {
7082 ctx .JSON (http .StatusOK , convert .ToActionRunner (ctx , runner ))
7183}
7284
85+ // Delete Runner for api route validated ownerID and repoID
86+ // ownerID == 0 and repoID == 0 means any runner including global runners
87+ // ownerID == 0 and repoID != 0 means any runner for the given repo
88+ // ownerID != 0 and repoID == 0 means any runner for the given user/org
89+ // ownerID != 0 and repoID != 0 undefined behavior
90+ // Access rights are checked at the API route level
7391func DeleteRunner (ctx * context.APIContext , ownerID , repoID , runnerID int64 ) {
7492 runner , err := actions_model .GetRunnerByID (ctx , runnerID )
7593 if err != nil {
0 commit comments