Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
services
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tencent
services
Commits
ae78351c
Commit
ae78351c
authored
Apr 14, 2020
by
王召彬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v2版本日志处理
parent
a0de6949
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
src/V2/Common/ClsLogger/ClsSignature.php
+5
-4
src/V2/Common/Config/CfgCenter.php
+1
-1
No files found.
src/V2/Common/ClsLogger/ClsSignature.php
View file @
ae78351c
...
...
@@ -2,18 +2,19 @@
namespace
Hdll\Services\V2\Common\ClsLogger
;
use
Hdll\Services\V2\Common\Config\CfgCenter
;
class
ClsSignature
{
public
static
function
create
(){
$signTime
=
(
time
()
-
10
)
.
';'
.
(
time
()
+
300
);
$secretKey
=
'IPL5g5PaaSAzd6NSO8gEmLxcN4pTzJSQ'
;
$secretId
=
'AKIDseHj18kua0KTSJ4g9SadbVEnEUZVjvPj'
;
$cosCfg
=
CfgCenter
::
getByOemId
(
'cls'
,
0
);
$sha1edHttpString
=
sha1
(
"post
\n
/structuredlog
\n\n\n
"
);
$stringToSign
=
"sha1
\n
{
$signTime
}
\n
{
$sha1edHttpString
}
\n
"
;
$signKey
=
hash_hmac
(
'sha1'
,
$signTime
,
$
secretKey
);
$signKey
=
hash_hmac
(
'sha1'
,
$signTime
,
$
cosCfg
[
'secretKey'
]
);
$signature
=
hash_hmac
(
'sha1'
,
$stringToSign
,
$signKey
);
$authorization
=
'q-sign-algorithm=sha1&q-ak='
.
$
secretId
$authorization
=
'q-sign-algorithm=sha1&q-ak='
.
$
cosCfg
[
'secretId'
]
.
"&q-sign-time=
{
$signTime
}
&q-key-time=
{
$signTime
}
&q-header-list=&q-url-param-list=&q-signature=
{
$signature
}
"
;
return
$authorization
;
}
...
...
src/V2/Common/Config/CfgCenter.php
View file @
ae78351c
...
...
@@ -172,7 +172,7 @@ class CfgCenter
if
(
$database
==
''
)
{
$database
=
'config_center'
;
}
if
(
\env
(
'
ENVIRONMENT'
,
''
)
==
'
'
)
{
if
(
\env
(
'
APP_DEV'
)
==
'prod
'
)
{
// 返回线上数据库连接
return
new
\Medoo\Medoo
([
'database_type'
=>
'mysql'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment