Impersonating roles for Horde scheduled jobs

Hi,

I have been trying to kick off a job on Horde from another job that runs on a schedule. We need this because the other job is based on another p4 stream so we couldn’t use chained jobs. To do this we added a new command that starts this new job using the Horde authentication token stored in HORDE_TOKEN env var. This works if the kick off job is started by a user but fails if started from a schedule. It fairly well explained in [this [Content removed] why this happens. The error we get is the same: “User does not have {Action} permission for stream {StreamId}”.

But I found this in the Horde documentation which at first glance seems to be the solution to the problem. So I tried adding the following in our configuration but without luck:

{
	"templates": [
		{
			"schedule" : {
				"claims": [
					{
						"type" : "http://epicgames.com/ue/horde/role",
						"value" : "start-chained-job"
					}
				]
			}
		}
	]
}

Am I using this incorrectly. What values does “claims” expect? I was trying to impersonate “start-chained-job” role because it appears to have CreateJob permission which seemed appropriate to what I was trying to do. Note: I inserted just the json lines of interest above.

Thanks, Daniel

Steps to Reproduce

  1. Create a command to start another job.
  2. Create a build graph that uses the command to start another job.
  3. Add a template for a job the runs the build graph.
  4. Schedule the job to run periodically add specify the role to impersonate.
  5. Notice that it doesn’t impersonate the given role.

Hi Daniel, thanks for the report. You are right, that’s indeed a bug! I have submitted a patch. If you build Horde from source, through GitHub, the change will visible in 2-3 hours.

Hi Carl,

Thank you for the fix.

I tested it and I can confirm I was able to create a job from another job ran by the scheduler by impersonating “start-chained-job” role.

Cheers, Daniel

[mention removed]​ FYI