Hi all,

Currently, the WSO2 API Manager offers the ability to define attributes for
applications. These application attributes can be populated when creating a
new application.
With this new feature, in addition to defining whether an attribute is
required, the user can also define whether that attribute should be hidden.
The speciality of a hidden attribute is that users are not allowed to
interfere with it's value.
An opportunity is given to define a default value to be used to populate
the hidden attribute and also in case a value is not provided for a
non-hidden required attribute when creating an Application. A hidden
attribute can also be populated via a customization to the workflow level.
The following topics summarise our approach to achieve this.

*Configuration*
The hidden application attributes should be defined as follows:

*<Attribute required="true" hidden="true">*
*   <Name>Testing</Name>*
*   <Default>Default value</Default>*
*   <Description>Sample test of the attribute</Description>*
*</Attribute>*


*Creating Application*

   - When an attribute is hidden, it will not be shown in the store UI, and
   this attribute should not be provided when creating an application through
   the rest API.
   - If a hidden attribute is defined as required, the default value
   defined will be added as the value for the hidden attribute.
   - If a required, non-hidden attribute is not provided when creating an
   application (in case this is done via the store REST APIs), and a default
   value is given, we add the default value, and if a default value is not
   given, we respond with a Bad Request error.
   - If a non-required hidden attribute is provided it will not be
   populated in any way, and left for the customization to handle it entirely.

*Update Application*

   - When an attribute is hidden, it will not be shown in the store UI, and
   this attribute should not be provided when updating an application through
   the rest API.
   - If a hidden attribute is tried to be updated in an update application
   call, the old value is persisted.
   - If a non-hidden required application attribute is not provided when
   updating an Application, the old value is persisted.
   - If a non-required hidden attribute is provided, the provided value is
   ignored and the existing value is used.

For a more detailed view of this approach refer this document [1]. Your
suggestions on this matter are much appreciated.

[1]
https://docs.google.com/spreadsheets/d/1Kor2WBbyxFs4h4Aq0w65jdLJPFrbN7wZSKtW8ie4YvU/edit?usp=sharing

Thanks,
Arshardh
-- 
*Arshardh Ifthikar*
Software Engineer | WSO2 Inc.

Email: [email protected]
Mobile: +94719806525
Web: http://wso2.com

<http://wso2.com/signature>
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to