Layer7 API Management

Expand all | Collapse all

Password Store Value Update Through a Service

Jump to Best Answer
  • 1.  Password Store Value Update Through a Service

    Posted 09-17-2018 08:35 PM

    Set a Password Store Key to modify its value either from a custom policy/ in-built policy?

    Is this possible?

    One of my password on the store is set to expire every 45 days, If we have a service to provide the key name and value to set this, we can avoid the manual work of logging into the policy manager manually?

     

    Typically,

    Something like api_key stored in password store 'a86facce-b512-4010-b29f-733075307536'

     

    Thanks

    Ganesh B



  • 2.  Re: Password Store Value Update Through a Service
    Best Answer

    Posted 09-18-2018 02:39 AM

    Hi,

     

    This Can be done through restman, you can update the password using PUT Call. Check more in Restman documentation.

    Create Or Update

    Creates or Updates an existing secure password. If a secure password with the given ID does not exist one will be created, otherwise the existing one will be updated.
    Request
    PUT 1.0/passwords/{id}
    Path Parameters
    ParamTypeDescription
    idstringID of the secure password to create or update
    Body
    Secure password to create or update
    Elementl7:StoredPassword
    Content-Typeapplication/xml
    Response
    Body
    A reference to the newly created or updated secure password.
    hope this will help.
    Regards,
    Grajesh Chandra


  • 3.  Re: Password Store Value Update Through a Service

    Posted 11-07-2018 06:45 PM

    Where can I find the restman documentation to use these API's?

     

    On my get call I see the following data:

    <l7:StoredPassword id="0479e1229a13d346b4d53add8a14282c" version="9">
    <l7:Name>sample</l7:Name>
    <l7:Properties>
    <l7:Property key="description">
    <l7:StringValue>sample password</l7:StringValue>
    </l7:Property>
    <l7:Property key="lastUpdated">
    <l7:DateValue>2018-11-07T21:06:39.392Z</l7:DateValue>
    </l7:Property>
    <l7:Property key="type">
    <l7:StringValue>Password</l7:StringValue>
    </l7:Property>
    <l7:Property key="usageFromVariable">
    <l7:BooleanValue>true</l7:BooleanValue>
    </l7:Property>
    </l7:Properties>
    </l7:StoredPassword>

     

    When I try to Post something like:

    <l7:StoredPassword  xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">ImK9ftXa0BsKdu</l7:StoredPassword>

     

    I get the following error:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <l7:Error xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
    <l7:Type>BadRequest</l7:Type>
    <l7:TimeStamp>2018-11-07T23:44:18.851Z</l7:TimeStamp>
    <l7:Link rel="self" uri="https://c2b0a0b5c46a:443/restman/1.0/passwords/0479e1229a13d346b4d53add8a14282c"/>
    <l7:Detail>HTTP 400 Bad Request. Caused by: cvc-complex-type.2.3: Element 'l7:StoredPassword' cannot have character [children], because the type's content type is element-only.</l7:Detail>
    </l7:Error>



  • 4.  Re: Password Store Value Update Through a Service

    Posted 11-09-2018 03:01 AM

    From our RESTman framework. Ussage both for creating/updating.