feat(guardian): rich consent supports authorization details#126
Conversation
Add support to `authorization_details` property in the Rich Consent record.
README.md
Outdated
| } | ||
| ``` | ||
|
|
||
| Or, if you prefer to work with typed objects, you can use the filter helper passing a Class that has been annotated with `@AuthorizationDetailsType("[type]")`. |
There was a problem hiding this comment.
I think we should be more forward in encouraging this as the default behaviour. See the wording that I put in the iOS README for comparison
README.md
Outdated
| } | ||
| ``` | ||
|
|
||
| Or, if you prefer to work with typed objects, you can use the filter helper passing a Class that has been annotated with `@AuthorizationDetailsType("[type]")`. |
There was a problem hiding this comment.
I think we probably need to make a reference to the GSON docs here. Whilst we don't explicitly expose any dependency on Gson objects in our inteface, our implementation is implicitly coupled to it and the types they define need to conform to the rules for deserialization (and can leverage things like their attributes for customization)
| } | ||
|
|
||
| public String getType() { | ||
| return "payment_initiation"; |
There was a problem hiding this comment.
Not keen on this. I feels a bit redundant declaring this statically since we are using the annotation. I know its just an example and it ultimately will get populated to this but I think it might lead to confusion by someone using this as a reference. I'd let this be a data value like the others and let the serialization populate it.
|
|
||
| setupUI(); | ||
|
|
||
| if (notification.getTransactionLinkingId() != null) { |
There was a problem hiding this comment.
This is much nicer than having the separate activities with all the logic in Main. This can probably be tidied up a bit though but adding so private methods to reduce the nesting a bit. You also have 3 code paths that all ultimately call updateUI() - pretty sure you can simplify
There was a problem hiding this comment.
I moved fragment initialization logic bits to private methods. About the three paths calling updateUI(), I did find a bug that caused the regular authentication fragment to always be shown before fetching the rich consent record. However, because it's "async" I didn't find an easy way to simplify it. If you've got ideas I'm all ears.
The bug has been fixed in b7f56a8
| Log.e(TAG, "Error requesting consent details", e); | ||
| } | ||
| } | ||
| startActivity(NotificationActivity.getStartIntent(this, notification, enrollment)); |
|
|
||
| <style name="Label.Small" parent="Label"> | ||
| <item name="android:textSize">12sp</item> | ||
| </style> |
There was a problem hiding this comment.
not sure it makes sense to create a style just for one TextSize attribute. Usually this approach is used when there's a need to group several elements, or when there's a design system in place. At the moment we have neither
There was a problem hiding this comment.
I think now that we removed the inline text size attribute from all the views, this style makes more sense now.
| android:layout_height="wrap_content" | ||
| android:layout_marginBottom="36dp" | ||
| android:textSize="12sp" | ||
| android:theme="@style/Label" |
There was a problem hiding this comment.
in this case the value of android:textSize attribute isn't being used because it's overridden by next element - android:theme="@style/Label" which contains textSize = 24.
Please pick just one attribute
| android:layout_width="match_parent" | ||
| android:layout_height="wrap_content" | ||
| android:layout_marginBottom="12dp" | ||
| android:textSize="12sp" |
There was a problem hiding this comment.
in this case the value of android:textSize attribute isn't being used because it's overridden by next element - android:theme="@style/Label" which contains textSize = 24.
Please pick just one attribute
| android:layout_width="match_parent" | ||
| android:layout_height="wrap_content" | ||
| android:text="Date" | ||
| android:textSize="12sp" |
There was a problem hiding this comment.
in this case textSize can be removed since the Label.Header is being used
| android:layout_width="match_parent" | ||
| android:layout_height="wrap_content" | ||
| android:text="Binding Message" | ||
| android:textSize="12sp" |
There was a problem hiding this comment.
in this case textSize can be removed since the Label.Header is being used
| android:layout_width="match_parent" | ||
| android:layout_height="wrap_content" | ||
| android:layout_marginBottom="12dp" | ||
| android:textSize="12sp" |
There was a problem hiding this comment.
in this case the value of android:textSize attribute isn't being used because it's overridden by next element - android:theme="@style/Label" which contains textSize = 24.
Please pick just one attribute
|
|
||
| layout = view.findViewById(R.id.dynamicAuthorizationDetailsLayout); | ||
| bindingMessageText = view.findViewById(R.id.bindingMessage); | ||
| dateText = view.findViewById(R.id.dateText); |
There was a problem hiding this comment.
for better readability it could be moved into a separate function named setupUI
| remittanceInfoText = view.findViewById(R.id.paymentRemittanceInformationText); | ||
| creditorAccountText = view.findViewById(R.id.paymentAccountText); | ||
| amountCurrencyText = view.findViewById(R.id.paymentAmountCurrencyText); | ||
| amountText = view.findViewById(R.id.paymentAmountText); |
There was a problem hiding this comment.
for better readability it could be moved into a separate function named setupUI
|
|
||
| bindingMessageText = (TextView) view.findViewById(R.id.bindingMessage); | ||
| scopeText = (TextView) view.findViewById(R.id.scope); | ||
| dateText = (TextView) view.findViewById(R.id.dateText); |
There was a problem hiding this comment.
for better readability it could be moved into a separate function named setupUI
| browserText = view.findViewById(R.id.browserText); | ||
| osText = view.findViewById(R.id.osText); | ||
| locationText = view.findViewById(R.id.locationText); | ||
| dateText = view.findViewById(R.id.dateText); |
There was a problem hiding this comment.
for better readability it could be moved into a separate function named setupUI
|
@SerhiiKobezaCapgemini I fixed all your requested changes. Thank you for your feedback. |
By submitting a PR to this repository, you agree to the terms within the Auth0 Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.
Description
Add support to
authorization_detailsproperty in the Rich Consent record.Adds a demo to the sample app that accepts "payment_initiation" authorization details type and displays the details in the consent screen.
References
Testing
Checklist