Uplink: api key format error: invalid macaroon version using us2 satellite

Using the latest storj/uplink@v1.4.5 and golang I can’t seem to talk to the US2 testing satellite.

Sample code is nearly straight from the walkthrough:

access, err := uplink.RequestAccessWithPassphrase(context.Background(),
        conf.SatelliteAddress,
        conf.ApiKey,
        conf.Passphrase)
if err != nil {
        return nil, fmt.Errorf("Could not request access grant: %v", err)
}

The address is us2.tardigrade.io:7777,
apiKey is 308 characters like 12b…sTc,
and the passphrase is random.

There doesn’t seem to be a newer version of Uplink available… Did I error on my side? Some other fix?

Try to generate a token like described here:
https://documentation.tardigrade.io/getting-started/generate-access-grants-and-tokens/generate-a-token

Yup, that seems to be it. Is the “continue in browser” method of creating an access grant being deprecated or something?

Any notifications of that change that I missed?

For posterity and to perhaps help someone else, here’s how I tested:

package main

import (
        "storj.io/uplink"
        "context"
        "fmt"
)

func main() {
        ctx := context.Background()
        /*
        // Could not request access grant: uplink: api key format error: invalid macaroon version
        satelliteAddress := "us2.tardigrade.io:7777"
        apiKey := "12b_snip_sTc"
        */

        // This works
        satelliteAddress := "12_snip_mo@us2.tardigrade.io:7777"
        apiKey := "1F_snip_KH"
        passphrase := "_random_text_"
        _, err := uplink.RequestAccessWithPassphrase(ctx, satelliteAddress, apiKey, passphrase)
        if err != nil {
                fmt.Printf("Could not request access grant: %v\n", err)
        }
}
1 Like

It’s a other way around. The API key is a deprecated feature, the access grant is what should be used instead.
However, you need to use other methods, which can consume access grants, not satellite address, API key and passphrase (by the way, you should specify a SatelliteID in the the satellite address, i.e. 12tRQrMTWUWwzwGh18i7Fqs67kmdhH9t6aToeiwbo5mfS2rUmo@us2.tardigrade.io:7777).