Wzone Lite AWS connection with woocommerce - amazon-product-api

Amazon Error: ErrCode = 1 | ErrMsg = [[ Amazon API v5:
http status code = 403
http msg = [403] Client error: `POST https://webservices.amazon.in/paapi5/searchitems` resulted in a `403 Forbidden` response: {"__type":"com.amazon.paapi5#AccessDeniedException","Errors":[{"Code":"AccessDenied","Message":"The Access Key Id AKIAII (truncated...)
http x-amzn-RequestId = 512c0bb2-9409-4f35-aa46-579b7a289c9d
errcode = AccessDenied
errmsg = The Access Key Id AKIAIIIXUUSHKX2VX6AA is not enabled for accessing Product Advertising API. Please sign up for Product Advertising API at https://affiliate-program.amazon.in/assoc_credentials/home. ]]
WooCommerce Amazon Affiliates was not able to connect to Amazon with the specified AWS Key Pair and Associate ID. Please triple-check your AWS Keys and Associate ID.

Related

Open Shift Confluent Operator : Failed to provision volume with StorageClass "managed-premium" AADSTS7000215: Invalid client secret provided

Zookeeper is unable to provision the pods on Open Shift :
The client id / secret has been configured in the secrets.
It is able to pick up the client id correctly
The client id secret is valid not expired.
Seeing this issue :
Failed to provision volume with StorageClass "managed-premium": Retriable: false, RetryAfter: 0s, HTTPStatusCode: 401, RawError: Retriable: false, RetryAfter: 0s, HTTPStatusCode: 401, RawError: azure.BearerAuthorizer#WithAuthorization: Failed to refresh the Token for request to https://management.azure.com/subscriptions/<XXXXX>/resourceGroups/<XXXXX>/providers/Microsoft.Compute/disks/<XXXXX>?api-version=2019-11-01: StatusCode=401 -- Original Error: adal: Refresh request failed. Status Code = '401'. Response body: {"error":"invalid_client","error_description":"AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app '<YYYYYYY>'.\r\nTrace ID: <BLAHHHHHH>\r\nCorrelation ID: <BLAHHHHHHHH>\r\nTimestamp: 2022-11-02 16:46:19Z","error_codes":[7000215],"timestamp":"2022-11-02 16:46:19Z","trace_id":"<BLAHHHHHH>","correlation_id":"<BLAHHHHHH>","error_uri":"https://login.microsoftonline.com/error?code=7000215"} Endpoint https://login.microsoftonline.com/<BLAHHHHHH>/oauth2/token
Verified credentials are valid and not expired

How can I connect to a moto mysql instance?

I created an RDS DB Instance using a mocked boto3 rds client. Here's how I set it up in my conftest.py
#pytest.fixture
def aws_credentials():
"""Mocked AWS Credentials for moto."""
os.environ["AWS_ACCESS_KEY_ID"] = "testing"
os.environ["AWS_SECRET_ACCESS_KEY"] = "testing"
os.environ["AWS_SECURITY_TOKEN"] = "testing"
os.environ["AWS_SESSION_TOKEN"] = "testing"
#pytest.fixture
def rds_client(aws_credentials, aws_region):
with mock_rds():
client = boto3.client("rds", region_name=aws_region)
yield client
Following the example here (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.Connecting.Python.html) I set up my mysql connector like this:
db_instance = rds_client.create_db_instance(DBInstanceIdentifier="TestDBInstanceIdentifier",
DBInstanceClass="db.m4.large", Engine="mysql",
MasterUsername="root", DBName="TestDBName")
print("RDS Instance-----------------------------------------------------")
print(db_instance)
host = db_instance['DBInstance']['Endpoint']['Address']
port = db_instance['DBInstance']['Endpoint']['Port']
user = db_instance['DBInstance']['MasterUsername']
dbname = db_instance['DBInstance']['DBName']
print("Starting connection")
token = rds_client.generate_db_auth_token(DBHostname=host, Port=port, DBUsername=user, Region=aws_region)
mydb = mysql.connector.connect(host=host, database=dbname, user=user, passwd=token, port=port)
However, the connector can't find the DB:
FAILED test_read_rds_db - mysql.connector.errors.DatabaseError: 2005 (HY000): Unknown MySQL server host 'TestDBInstanceIdentifier.aaaaaaaaaa.us-east-1.rds.amazonaws.com' (8)
Has someone been able to set this up before?
Moto does not offer this functionality. It mocks the AWS API, but does not expose any RDBMS-functionality.
You could look into Localstack instead. It uses Moto in the background to mock calls to AWS, but offers features on top of that such as the ability to connect to an RDS instance.
See the docs here: https://docs.localstack.cloud/aws/rds/

cURL error: Failed to connect to xxxxxx(bucketname) port 80: Connection timed out (7)

I am uploading a file to Alibaba Cloud - OSS bucket. Have correct access key and secret key.
Using oss-sdk-php through yii2, Getting Error
{"name":"PHP Fatal Error","message":"Uncaught exception
'OSS\Core\OssException' with message 'RequestCoreException: cURL
resource: Resource id #351; cURL error: Failed to connect to
chinaproduct.oss-cn-beijing.aliyuncs.com port 80: Connection timed out
(7)'
Unable to get exact issue, any help would be appreciated.
// #### Delete old files / Fetch all files with prefix
$listObjectInfo = $ossClient->listObjects($productBucket,array('prefix'=>$uploadProductPrefix));
$objectList = $listObjectInfo->getObjectList();
foreach ($objectList as $objectInfo) {
$fileNameToDelete = $objectInfo->getKey();
$ossClient->deleteObject($productBucket,$fileNameToDelete);
\Yii::info("OSS : Deleted file from OSS -$productBucket - $fileNameToDelete");
}
} catch (OssException $e) {
\Yii::info("OSS : Unable to delete old files from OSS $productBucket for dataId $dataId " . $e);
}

While configuring the Python Amazon Product API, it gives unknown locale error for 'locale'='in'

I am new to the Amazon Product API. I have installed the Python Amazon Product API. I am trying to initialise the Amazon API with my access no, secret key and affiliate tag, and locale. I am using 'locale' : 'in'. It gives unknown locale error. With other locale like "us", or "uk", it does not give an error. Can some one please help me out.
My code:
import amazonproduct
config = {
'access_key': '***************',
'secret_key': '**************************',
'associate_tag': '************',
'locale': 'in'
}
api = amazonproduct.API(cfg=config)
The error is:
UnknownLocale
Traceback (most recent call last)
<ipython-input-56-6af6386efe00> in <module>()
5 'locale': 'in'
6 }
----> 7 api = amazonproduct.API(cfg=config)
/Users/niharsuryawanshi/anaconda/lib/python2.7/site-packages/amazonproduct/api.pyc in __init__(self, access_key_id, secret_access_key, locale, associate_tag, processor, cfg)
153 self.host = HOSTS[self.locale]
154 except KeyError:
--> 155 raise UnknownLocale(locale)
156
157 # GAE does not allow timeouts to be specified manually
UnknownLocale: None
This is still under work:
https://bitbucket.org/basti/python-amazon-product-api/issues/58/dose-this-lib-support-indian-amazon-also
While the fix is trivial, a patch won't be officually accepted until the library's tests have been adjusted as well.

Create Certificate with domain account

Is it possible to create an endpoint in SQL Server 2008 Service Broker with support for
Certificate based authentication and using domain account for Authorization?
e.g.
CREATE ENDPOINT ServiceBrokerEndpoint
AUTHORIZATION [domain\username]
STATE=STARTED AS TCP (LISTENER_PORT = 4022, LISTENER_IP = ALL)
FOR SERVICE_BROKER (MESSAGE_FORWARDING = DISABLED, MESSAGE_FORWARD_SIZE = 10, AUTHENTICATION = CERTIFICATE [CertificateName], ENCRYPTION = SUPPORTED ALGORITHM RC4)
Try this
-------------------------------------
-- connect to server
-------------------------------------
use master;
go
create master key encryption by password = '...';
create certificate [<servername>]
with subject = '<servername>'
, start_date = '20100216'
, expiry_date = '20150216';
create endpoint broker
state = started
as tcp (listenner_port = 4022)
for service_broker (authentication = certificate [<servername>]);
-- Export the public key to disk
backup certificate [<servername>]
to file = '\\someshare\<servername>.cer';
--------------------------------
-- connect to client
--------------------------------
use master;
go
create master key encryption by password = '...';
create certificate [<clientname>]
with subject = '<clientname>'
, start_date = '20100216'
, expiry_date = '20150216';
create endpoint broker
state = started
as tcp (listenner_port = 4022)
for service_broker (authentication = certificate [<clientname>]);
-- Export the public key to disk
backup certificate [<clientname>]
to file = '\\someshare\<clientname>.cer';
--create an identity for server and import the server's certificate:
create login [<servername>] with password = '...';
alter login [<servername>] disable;
create user [<servername>];
create certificate [<servername>]
authorization [<servername>]
from file = '\\someshare\<servername>.cer';
--authorize <servername> to connect on the broker endpoint
grant connect on endpoint::broker to [<servername>];
---------------------------------------
-- connect to the server
---------------------------------------
--create an identity for client and import the client's certificate:
create login [<clientname>] with password = '...';
alter login [<clientname>] disable;
create user [<clientname>];
create certificate [<clientname>]
authorization [<clientname>]
from file = '\\someshare\<clientname>.cer';
--authorize <clientname> to connect on the broker endpoint
grant connect on endpoint::broker to [<clientname>];