Getting Access Key ID from Go client library

Getting access key from uplink Share in golang

I’m wondering how I can get the Access Key ID from website_access defined below. I’m new to golang, so excuse any dumb questions…


// Request access grant to the satellite with the access grant string

access, err := uplink.ParseAccess("storj_access_grant")

// Create new read only access grant for website

website_access, err := access.Share(uplink.ReadOnlyPermission())

I’m trying to do the same thing as the following command line code, but in Go:

uplink.exe share --dns www sj://somebucket

The command line interface returns “Access Key ID” which is what I want to get in Go… so I can programmatically get the key for use in public access

Hi,

this is not available in the uplink library but you can have a look at the share command implementation. The shareMain function should help you get what you want.

1 Like

Thanks @Fadila! Your suggestion pointed me in the right direction.