How to store a password longer than 99 characters in plugin parameters

Started by rvbgnu, August 11, 2020, 13:50:36 PM

Previous topic - Next topic

rvbgnu

Hello,

I need to store larger API keys, and I found a strange issue: in the XML configuration of the plugin, I cannot store a password longer than 99 characters.

I have this example to explain better my concern:

<field name="test_secret_key" type="password" size="35" default="" label="VMPAYMENT_STRIPE_TEST_SECRET_KEY"
       description="VMPAYMENT_STRIPE_TEST_SECRET_KEY_DESC"/>
<field name="test_publishable_key" type="text" size="35" default=""
       label="VMPAYMENT_STRIPE_TEST_PUBLISHABLE_KEY"
       description="VMPAYMENT_STRIPE_TEST_PUBLISHABLE_KEY_DESC"/>


From the back end, when I save the test_secret_key, it is truncated after 99 chars. It is ONLY happening for the fields in XML type="password". With type="text" it can be larger, no problem.
I even tried to edit directly the Database: the longer key can be stored that way, and use in the front end plugin. But as soon as I edit in the back end, the test_secret_key gets truncated again.

I have tested with the Paypal plugin, and the type password behaves the same way.
http://dev.virtuemart.net/projects/virtuemart/repository/revisions/10338/entry/trunk/virtuemart/plugins/vmpayment/paypal/paypal.xml#L45

Would you have any idea to solve that issue and update the code?

Thanks!
Best Regards, Hervé Boinnard - Irish Time (GMT)
Joomla! multilingual website and online business made easy - https://www.puma-it.ie

3D Secure v1 (3DS1) & Strong Customer Authentication (SCA)! Stripe.com payment plugin for VirtueMart 3: https://www.puma-it.ie/en/joomla-and-virtuemart-extensions/stripe-for-virtuemart
Authipay (AIB Merchant Services) for VirtueMart 2 & 3: https://www.puma-it.ie/en/joomla-and-virtuemart-extensions/authipay-aib-merchant-services-for-virtuemart

AH

You should be able to override the "99"

https://docs.joomla.org/Text_form_field_type

"maxlength (optional) limits the number of characters that may be entered."


<field name="test_secret_key" type="password" size="35" maxlength="200" default="" label="VMPAYMENT_STRIPE_TEST_SECRET_KEY"
       description="VMPAYMENT_STRIPE_TEST_SECRET_KEY_DESC"/>
<field name="test_publishable_key" type="text" size="35" maxlength="200" default=""
       label="VMPAYMENT_STRIPE_TEST_PUBLISHABLE_KEY"
       description="VMPAYMENT_STRIPE_TEST_PUBLISHABLE_KEY_DESC"/>
Regards
A

Joomla 4.4.5
php 8.1

rvbgnu

Oh woah! Thanks a Millions AH!

It works perfectly!
After a fix release, I am going to update other similar fields, especially the API keys, password, passphrases, etc... and add it to the next minor release.

AH, I owe you one (or more). If you need the plugin at a discount, please just ping me!

Have a lovely day everyone!
Best Regards, Hervé Boinnard - Irish Time (GMT)
Joomla! multilingual website and online business made easy - https://www.puma-it.ie

3D Secure v1 (3DS1) & Strong Customer Authentication (SCA)! Stripe.com payment plugin for VirtueMart 3: https://www.puma-it.ie/en/joomla-and-virtuemart-extensions/stripe-for-virtuemart
Authipay (AIB Merchant Services) for VirtueMart 2 & 3: https://www.puma-it.ie/en/joomla-and-virtuemart-extensions/authipay-aib-merchant-services-for-virtuemart

AH

Great to know it works for your problem and thanks for posting an update :-)

QuoteAH, I owe you one (or more).

I owe so many more people - it is nice to be able to help others :-)
Regards
A

Joomla 4.4.5
php 8.1

rvbgnu

Best Regards, Hervé Boinnard - Irish Time (GMT)
Joomla! multilingual website and online business made easy - https://www.puma-it.ie

3D Secure v1 (3DS1) & Strong Customer Authentication (SCA)! Stripe.com payment plugin for VirtueMart 3: https://www.puma-it.ie/en/joomla-and-virtuemart-extensions/stripe-for-virtuemart
Authipay (AIB Merchant Services) for VirtueMart 2 & 3: https://www.puma-it.ie/en/joomla-and-virtuemart-extensions/authipay-aib-merchant-services-for-virtuemart

AH

"# Add support for New longer Stripe API keys (Thank you AH!)"

Nice touch :-)
Regards
A

Joomla 4.4.5
php 8.1

jenkinhill

@rvbgnu  this reminded me to update the Stripe plugin on a client site. Thanks.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

rvbgnu

Great stuff Kelvyn! Thanks to you for using our Stripe plugin ;-)
Best Regards, Hervé Boinnard - Irish Time (GMT)
Joomla! multilingual website and online business made easy - https://www.puma-it.ie

3D Secure v1 (3DS1) & Strong Customer Authentication (SCA)! Stripe.com payment plugin for VirtueMart 3: https://www.puma-it.ie/en/joomla-and-virtuemart-extensions/stripe-for-virtuemart
Authipay (AIB Merchant Services) for VirtueMart 2 & 3: https://www.puma-it.ie/en/joomla-and-virtuemart-extensions/authipay-aib-merchant-services-for-virtuemart