Skip to content
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

Simple feature idea: URL generation #37

Open
copumpkin opened this issue Apr 1, 2015 · 4 comments
Open

Simple feature idea: URL generation #37

copumpkin opened this issue Apr 1, 2015 · 4 comments

Comments

@copumpkin
Copy link
Contributor

hologram url could write a federated access URL for your current hologram user to stdout. On a Mac, you could then run hologram url | xargs open and it would pop open a browser pointing at the AWS console.

The logic for this could live in pure client code and wouldn't need any protocol modifications. I'm pretty sure I could implement it in a handful of lines if you were interested.

My main concern about this is that the logic doesn't really feel specific to hologram. We'd just be running a standard STS operation against the current instance credentials. Putting it under hologram would thus be just for the sake of a consistent Amazon "user experience", rather than because it needs to be here.

Thoughts?

@frangarciam
Copy link
Contributor

I have a similar concern, as in we have to be careful not to bloat hologram with tons of options/features, but that does sound like it might be useful for some people without affecting the core functionality, so I'd be happy to review any PR you might want to send our way.

@walterking
Copy link
Contributor

from boto import sts

import requests

import simplejson as json

import urllib

conn = sts.STSConnection()

role = conn.assume_role(','')

session = {
"sessionId":role.credentials.access_key,"sessionKey":role.credentials.secret_key,"sessionToken":role.credentials.session_token}

params = { "Action":"getSigninToken","Session":json.dumps(session)}

r=requests.get("https://signin.aws.amazon.com/federation", params=params)

token=json.loads(r.text)['SigninToken']

params2 = { "Action":"login", "Issuer":"adroll.com","Destination":"
https://console.aws.amazon.com/console/home","SigninToken":token}

print "https://signin.aws.amazon.com/federation?{}
".format(urllib.urlencode(params2))

neat. i just verified this works with hologram.

On Wed, Apr 1, 2015 at 10:18 AM, Fran Garcia [email protected]
wrote:

I have a similar concern, as in we have to be careful not to bloat
hologram with tons of options/features, but that does sound like it might
be useful for some people without affecting the core functionality, so I'd
be happy to review any PR you might want to send our way.


Reply to this email directly or view it on GitHub
#37 (comment).

@copumpkin
Copy link
Contributor Author

Yeah, I use something similar except with the current credentials instead
of another STS call. Just figured it would be smooth to add to the CLI :)

On Thursday, April 2, 2015, Walter King [email protected] wrote:

from boto import sts

import requests

import simplejson as json

import urllib

conn = sts.STSConnection()

role = conn.assume_role(','')

session = {

"sessionId":role.credentials.access_key,"sessionKey":role.credentials.secret_key,"sessionToken":role.credentials.session_token}

params = { "Action":"getSigninToken","Session":json.dumps(session)}

r=requests.get("https://signin.aws.amazon.com/federation", params=params)

token=json.loads(r.text)['SigninToken']

params2 = { "Action":"login", "Issuer":"adroll.com","Destination":"
https://console.aws.amazon.com/console/home","SigninToken":token}

print "https://signin.aws.amazon.com/federation?{}
".format(urllib.urlencode(params2))

neat. i just verified this works with hologram.

On Wed, Apr 1, 2015 at 10:18 AM, Fran Garcia <[email protected]
javascript:_e(%7B%7D,'cvml','[email protected]');>
wrote:

I have a similar concern, as in we have to be careful not to bloat
hologram with tons of options/features, but that does sound like it might
be useful for some people without affecting the core functionality, so
I'd
be happy to review any PR you might want to send our way.


Reply to this email directly or view it on GitHub
#37 (comment).


Reply to this email directly or view it on GitHub
#37 (comment).

@ryansydnor
Copy link
Contributor

I took a slightly different approach to the same problem and made a Chrome extension that leverages instance metadata to open the console. Closed this issue by building Holochrome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants