'Add \'links\' entry to the response dictionary.
Calls IdentityProvider.base_url() class method, as it constructs
proper URL along with the \'identity providers\' part included.
:param ref: response dictionary'

@classmethod
def _add_self_referential_link(cls, context, ref):

    ref.setdefault('links', {})
    base_path = ref['links'].get('identity_provider')
    if (base_path is None):
        base_path = [IdentityProvider.base_url(context), ref['idp_id']]
        base_path = '/'.join(base_path)
    self_path = [base_path, 'protocols', ref['id']]
    self_path = '/'.join(self_path)
    ref['links']['self'] = self_path
