Exemplo n.º 1
0
Arquivo: v4.py Projeto: redsymbol/faws
def credential_scope(region, service_name, when):
    return ''.join([
            datefmt(when),
            '/',
            region,
            '/',
            service_name,
            '/',
            'aws4_request',
            ])
Exemplo n.º 2
0
Arquivo: v4.py Projeto: redsymbol/faws
def _signing_key(secret_key, when, region, service_name):
    '''
    Generates signing key and all intermediate values

    Mainly useful for testing.  Normally use signing_key() instead.
    
    '''
    vals = dict()
    vals['kSecret']  = b'AWS4' + secret_key.encode('utf-8')
    vals['kDate']    = hmacdigest(vals['kSecret'], datefmt(when))
    vals['kRegion']  = hmacdigest(vals['kDate'], region)
    vals['kService'] = hmacdigest(vals['kRegion'], service_name)
    vals['kSigning'] = hmacdigest(vals['kService'], "aws4_request")
    return vals