Open DemianTinkiel opened 4 years ago
Yes, this is by design. The purpose of title
is different from externalId
. So far, the title
is set always to the domain ID like href and therefore mostly useless. Now that you ask - yes, your question is relevant - I will probably remove it to avoid the confusion. The original intent was to keep the API as minimal as possible, and let the API consumer - a User Interface of any kind for instance - handle all the display names, description, etc. in its own database, and make the link with AuthzForce API's domain via the externalId
. So if I follow this approach, I should probably remove the description
property as well. Not sure anymore why it has been there originally.
I guess I should have asked when I was doing authzforce/java-xacml-sdk#17 . As the doDomainIdTranslation
becomes nearly useless if you don't already know the domain names. I was hoping to be able to do domain discovery without doing extra steps like
adminXacmlSdk.getDomains().forEach(link -> {
try {
domains.put(adminXacmlSdk.getDomain(link.getHref()).getExternalId(), link.getHref());
} catch (XacmlSdkException e) {
LOG.error("Error listing domains ", e);
}
});
getDomains(externalID)
works with the human-readable name, while getDomain(STRING)
only works with the id/href unless you use the doDomainIdTranslation
.
I understand wanting to keep the API concise, so description probably doesn't make sense but title can still have a use within HATEOS.
Anyway, thanks for clearing it out. Shall I close this or do you want to use it to track the removal of title & description?
Keep this open, I will look at how title
is used in HATEOAS, and check whether it is worth keeping it (and make it configurable via API like other domain properties).
I was looking at getDomains, specially in reference to https://github.com/authzforce/java-xacml-sdk/issues/17 and I noticed that getDomains returns something like
yet getDomains/{domainID}
returns something like
Is this by design? I guess I expected the response of getDomains to be something like