|
@@ -19,18 +19,17 @@ def getCredentials():
|
|
|
|
|
|
sts = boto3.client(
|
|
|
'sts',
|
|
|
- aws_access_key_id='AKIAIXAA4C3QCK7ZNUOA',
|
|
|
- aws_secret_access_key='7h1cV8wSkJpvMELjS/3Zutp1t3/LAxJYY60oZ5gH',
|
|
|
+ aws_access_key_id='AKIA2E67UIMD45Y3HL53',
|
|
|
+ aws_secret_access_key='ckYLg4Lo9ZXJIcJEAKkzf2rWvs8Xth1FCjqiAqUw',
|
|
|
region_name=REGION_NAME
|
|
|
)
|
|
|
|
|
|
Policy = {"Version": "2012-10-17",
|
|
|
- "Statement": [{"Effect": "Allow", "Action": "s3:*", "Resource": ["arn:aws:s3:::ansjerfilemanager/*"]}]}
|
|
|
+ "Statement": [{"Effect": "Allow", "Action": "kinesisvideo:*", "Resource": ["arn:aws:kinesisvideo:us-east-1:697864307463:stream/wpy_stream/1573460250304"]}]}
|
|
|
credentials = sts.get_federation_token(
|
|
|
Name='chanjunkai@163.com', # or any unique text related to user
|
|
|
Policy=json.dumps(Policy),
|
|
|
DurationSeconds=3600,
|
|
|
- # minimum is 200 which is enough as token is just for start of request and necessarily need not live throughout the life of the whole upload.
|
|
|
)
|
|
|
|
|
|
print(credentials)
|
|
@@ -38,8 +37,9 @@ def getCredentials():
|
|
|
session_token = credentials['Credentials']['SessionToken']
|
|
|
secret_access_key = credentials['Credentials']['SecretAccessKey']
|
|
|
|
|
|
-# getCredentials()
|
|
|
-#
|
|
|
+getCredentials()
|
|
|
+
|
|
|
+exit()
|
|
|
# exit()
|
|
|
def getCredentialsTemplate():
|
|
|
import boto3
|