chenjunkai 5 년 전
부모
커밋
8314509798
2개의 변경된 파일7개의 추가작업 그리고 6개의 파일을 삭제
  1. 6 6
      Ansjer/test/s3sts.py
  2. 1 0
      Model/models.py

+ 6 - 6
Ansjer/test/s3sts.py

@@ -19,18 +19,17 @@ def getCredentials():
 
     sts = boto3.client(
         'sts',
-        aws_access_key_id='AKIAIXAA4C3QCK7ZNUOA',
-        aws_secret_access_key='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',
+        aws_access_key_id='AKIA2E67UIMD45Y3HL53',
+        aws_secret_access_key='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',
         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

+ 1 - 0
Model/models.py

@@ -490,6 +490,7 @@ class Equipment_Version(models.Model):
     lang = models.CharField(blank=True, default='en', max_length=32, verbose_name=u'ota包内置语言')
     mci = models.CharField(default='', blank=True, max_length=10, verbose_name='设备类型')
     img = models.TextField(blank=True, default='', verbose_name=u'图片路径')
+    # min_ver = models.CharField(default='',verbose_name='最小版本号')
 
     def __str__(self):
         return self.eid