Laravel-chef服务器用户或客户端的签名无效

时间:2016-04-05 13:53:45

标签: php laravel chef

尝试使用Jenssegers/php-chef包连接到Chef服务器,但它没有通过授权。似乎创建签名但引发错误:

Exception in Chef.php line 187:
Invalid signature for user or client 'test'

这是我的配置主厨文件:

return [
'server'    => 'https://172.16.0.227:443/organizations/myOrgName',
'client'    => 'test',
'key'       => '../.chef/test.pem',
'version'   => '12.4.1',
'enterprise' => false
];

我尝试将enterprise设置为true,但它返回相同的错误。这是生成的标题:

"Accept: application/json"
"Content-Type: application/json"
"X-Chef-Version: 12.4.1"
"X-Ops-Reporting-Protocol-Version: 0.1.0"
"X-Ops-Sign: algorithm=sha1;version=1.0"
"X-Ops-UserId: test"
"X-Ops-Timestamp: 2016-04-05T14:19:35Z"
"X-Ops-Content-Hash: 2jmj7l5rSw0yVb/vlWAYkK/YBwk="
"X-Ops-Authorization-1: o1YdPBVm9uBCz9ZK/b9S6J8L/4z1rH6ep8LmnSqrV1HKK2m5og2o32cv7PUp"
"X-Ops-Authorization-2: 81rk1uTsxy67mOXXuH2T/T4r2nl+WP2pCdpzSUPX6XF8HKSgIMG9TkIzBNcS"
"X-Ops-Authorization-3: ckh5rvj/rtp/XX/VmulOa337cY45I0AudC2MF03LcAPC7sjIekX3NI+xxLe9"
"X-Ops-Authorization-4: 6+lgWndwndql9R/JVwTPIA2VocHt1qFvYrPLRwjr2+x8XE5UGJ3WhRERxEeU"
"X-Ops-Authorization-5: /Z83gjJJsyoFbAw1mWfQJpPbSf2H1Jbit+vd0H5JO28OTVukXLdY5Phk6oQp"
"X-Ops-Authorization-6: yyLpsrvqQeOtZcSBHCKOGigM/HiFO5ZyyDENd6B1Zw=="

1 个答案:

答案 0 :(得分:0)

我很确定你希望List<Integer> maxInd = maxIndicies(list); maxValue = maxInd.isEmpty() ? null : list.get(maxInd.get(0)); 成为现实,但我不知道这是否会解决问题。你能获得一个包含实际生成的身份验证标头的调试日志吗?