samson icon indicating copy to clipboard operation
samson copied to clipboard

Use deployer's oauth token for GitHub deployments API

Open ibrahima opened this issue 5 years ago • 3 comments

I realize this is probably not possible right now because of https://github.com/zendesk/samson/issues/51, but it would be nice if the GitHub create deployment API would show up with the actual deployer having deployed instead of as the "service user" that was configured in the .env file. It seems like the deployments API doesn't let you say who deployed via the API, so it will always show up as the user for Samson. Not super important since we can look up that info by looking at the deploy on Samson, but more of a nice to have. Just bringing this up because I'm not sure if this is already possible somehow and I've misconfigured something.

ibrahima avatar Jul 30 '19 07:07 ibrahima

I don't think that works since we'd have to auth as that user ... unless saying who deployed is part of the deployment api.

grosser avatar Aug 01 '19 04:08 grosser

Yeah I guess I'm requesting that you could auth as the user, I think that's how the deployment API is meant to find out who deployed (otherwise, it's just something like "Samson deployed blah..."). But I don't know if you get/store user's OAuth tokens right now.

It would be nice if the API just let you specify the username who initiated the deploy but it seems like it does not let you do that: https://developer.github.com/v3/repos/deployments/#create-a-deployment. Maybe I should make a feature request to the GitHub API team.

ibrahima avatar Dec 20 '19 00:12 ibrahima

Sending a username over would be much simpler :) ... I doubt the oauth token samson gets during login works with anything but samson. So only other way would be a per-user column of oauth token that we then send ... which would be hard to configure for each user ...

grosser avatar Dec 20 '19 00:12 grosser