* N.B. Sets isLoopback on urlObj
* @param {URL} urlObj
* @param {Boolean} allowLoopback
+ * @param {Boolean} resolveHostname
* @returns {Promise<void>}
*/
static async _urlNamedHost(urlObj, allowLoopback, resolveHostname) {
* Ensure a url meets the requirements to be a profile uri.
* @param {String} url
* @param {Object} validationOptions
- * @param {Boolean} validationOptions.allowLoopback
- * @param {Boolean} validationOptions.resolveHostname
- * @returns {Promise<void>}
+ * @param {Boolean=} validationOptions.allowLoopback default is false, following spec
+ * @param {Boolean=} validationOptions.resolveHostname default is false, following spec
+ * @returns {Promise<URL>}
*/
async validateProfile(url, validationOptions) {
const _scope = _fileScope('validateProfile');
/**
* Ensure a url meets the requirements to be a client identifier.
- * Sets 'isLoopback' on returned URL object to true if hostname is or resolves to a loopback ip.
+ * Sets 'isLoopback' on returned URL object to true if hostname is - or resolves to - a loopback ip.
* @param {String} url
* @param {Object} validationOptions
- * @param {Boolean} validationOptions.allowLoopback
- * @param {Boolean} validationOptions.resolveHostname
+ * @param {Boolean=} validationOptions.allowLoopback default is true, following spec
+ * @param {Boolean=} validationOptions.resolveHostname default is true, following spec
* @returns {Promise<URL>}
*/
async validateClientIdentifier(url, validationOptions) {
* Retrieve and parse client identifier endpoint data.
* N.B. Assumes urlObj has passed validateClientIdentifier.
* @param {URL} urlObj
- * @returns {ClientIdentifierData|undefined} mf2 data filtered for h-app items, or undefined if url could not be fetched
+ * @returns {Promise<ClientIdentifierData|undefined>} mf2 data filtered for h-app items, or undefined if url could not be fetched
*/
async fetchClientIdentifier(urlObj) {
const _scope = _fileScope('fetchClientIdentifier');
/**
* Fetch the relevant microformat data from profile url h-card information,
* and authorization server metadata.
+ * N.B. Assumes urlObj has passed validateProfile
* @param {URL} urlObj
- * @returns {ProfileData} mf2 data filtered for select fields from h-card
+ * @returns {Promise<ProfileData>} mf2 data filtered for select fields from h-card
*/
async fetchProfile(urlObj) {
const _scope = _fileScope('fetchProfile');
* @param {String} codeVerifier
* @param {String} clientId
* @param {String} redirectURI
- * @returns {Object}
+ * @returns {Promise<Object>}
*/
async redeemCode(urlObj, code, codeVerifier, clientId, redirectURI) {
const _scope = _fileScope('redeemCode');
* @param {Strin} codeVerifier
* @param {String} clientId
* @param {String} redirectURI
- * @returns {Object}
+ * @returns {Promise<Object>}
*/
async redeemProfileCode(urlObj, code, codeVerifier, clientId, redirectURI) {
return this.redeemCode(urlObj, code, codeVerifier, clientId, redirectURI);
* @param {URL} introspectionUrlObj
* @param {String} authorizationHeader
* @param {String} token
+ * @returns {Promise<Object>}
*/
async introspectToken(introspectionUrlObj, authorizationHeader, token) {
const _scope = _fileScope('introspectToken');
* @param {URL} resourceUrlObj
* @param {URL} subjectUrlObj
* @param {String} ticket
- * @returns {Promise<AxiosResponse>}
+ * @returns {Promise<Response>}
*/
async deliverTicket(ticketEndpointUrlObj, resourceUrlObj, subjectUrlObj, ticket) {
const _scope = _fileScope('deliverTicket');