gmo/credstash-php

HMAC missing

Closed this issue · 1 comments

Hi,

I've been using this library and it stopped working today.

I keep getting the following error:

PHP Notice: Undefined index: S in PATH/vendor/gmo/credstash/src/Store/DynamoDbStore.php on line 207

that line contains this method:

    private function createCredential($item)
    {
        $cred = (new Credential())
            ->setName($item['name']['S'])
            ->setVersion($item['version']['S'])
            ->setKey($item['key']['S'])
            ->setContents($item['contents']['S'])
            ->setHash($item['hmac']['S'])
        ;
        return $cred;
    }

After further investigation, it seems that the HMAC is returned with B instead of S.

Once i changed it to use

$item['hmac']['B']

that fixed it.

I'm not sure if that's something that was changed on AWS's side.

Thanks,

Closing this, it was an issue with how our credentials were being stored.