-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3624 from apinf/develop
release 0.58.0
- Loading branch information
Showing
21 changed files
with
413 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
This document helps you getting started with APInf API management. | ||
|
||
### After successful installation ### | ||
|
||
1) sign-up (if you are the 1st user, you'll get admin rights!) | ||
2) sign-in | ||
3) add a Proxy (if it does not already exist) | ||
5) add an API and connect it to a Proxy | ||
6) test | ||
7) Yay! | ||
|
||
### How to use the GUI: ### | ||
GUI is designed to be self explanatory, but check out this awesome getting started video on youtube! | ||
|
||
https://www.youtube.com/watch?v=yCR6pCnTm5w&t=190s | ||
|
||
#### Contact #### | ||
contact info@apinf.io if you ran into trouble. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ <h3> | |
Apinf | ||
</dt> | ||
<dd> | ||
0.57.0 | ||
0.58.0 | ||
</dd> | ||
<dt> | ||
API Umbrella | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* Copyright 2018 Apinf Oy | ||
This file is covered by the EUPL license. | ||
You may obtain a copy of the licence at | ||
https://joinup.ec.europa.eu/community/eupl/og_page/european-union-public-licence-eupl-v11 */ | ||
|
||
// Meteor packages imports | ||
import { Meteor } from 'meteor/meteor'; | ||
import { Accounts } from 'meteor/accounts-base'; | ||
|
||
Accounts.oauth.registerService('hsl'); | ||
|
||
Meteor.loginWithHsl = function (optionsIn, callbackIn) { | ||
let options = optionsIn; | ||
let callback = callbackIn; | ||
// support a callback without options | ||
if (!callback && typeof options === 'function') { | ||
callback = options; | ||
options = null; | ||
} | ||
|
||
const credentialRequestCompleteCallback = | ||
Accounts.oauth.credentialRequestCompleteHandler(callback); | ||
/* global Hsl */ | ||
Hsl.requestCredential(options, credentialRequestCompleteCallback); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* Copyright 2018 Apinf Oy | ||
This file is covered by the EUPL license. | ||
You may obtain a copy of the licence at | ||
https://joinup.ec.europa.eu/community/eupl/og_page/european-union-public-licence-eupl-v11 */ | ||
|
||
// Npm packages imports | ||
import { Random } from 'meteor/random'; | ||
import { OAuth } from 'meteor/oauth'; | ||
|
||
// Meteor contributed packages imports | ||
import { ServiceConfiguration } from 'meteor/service-configuration'; | ||
|
||
/* global Hsl:true */ | ||
Hsl = {}; | ||
|
||
// Request OpenID Connect credentials for the user | ||
// @param options {optional} | ||
// @param credentialRequestCompleteCallback {Function} Callback function to call on | ||
// completion. Takes one argument, credentialToken on success, or Error on | ||
// error. | ||
/* global Hsl:true */ | ||
Hsl.requestCredential = function (optionsIn, credentialRequestCompleteCallbackIn) { | ||
let options = optionsIn; | ||
let credentialRequestCompleteCallback = credentialRequestCompleteCallbackIn; | ||
// support both (options, callback) and (callback). | ||
if (!credentialRequestCompleteCallback && typeof options === 'function') { | ||
credentialRequestCompleteCallback = options; | ||
options = {}; | ||
} | ||
|
||
const config = ServiceConfiguration.configurations.findOne({ service: 'hsl' }); | ||
if (!config) { | ||
// eslint-disable-next-line | ||
credentialRequestCompleteCallback && credentialRequestCompleteCallback(new ServiceConfiguration.ConfigError('Service hsl not configured.')); | ||
return; | ||
} | ||
// eslint-disable-next-line | ||
/* eslint no-underscore-dangle: ["error", { "allow": ["_loginStyle", "_redirectUri", "_stateParam"]}] */ | ||
|
||
const credentialToken = Random.secret(); | ||
const loginStyle = OAuth._loginStyle('hsl', config, options); | ||
const scope = config.requestPermissions || ['openid', 'profile', 'email']; | ||
|
||
// options | ||
options = options || {}; | ||
options.client_id = config.clientId; | ||
options.response_type = options.response_type || 'code'; | ||
options.redirect_uri = OAuth._redirectUri('hsl', config); | ||
options.state = OAuth._stateParam(loginStyle, credentialToken, options.redirectUrl); | ||
options.scope = scope.join(' '); | ||
|
||
if (config.loginStyle && config.loginStyle === 'popup') { | ||
options.display = 'popup'; | ||
} | ||
|
||
let loginUrl = config.serverUrl + config.authorizationEndpoint; | ||
// check if the loginUrl already contains a "?" | ||
let first = loginUrl.indexOf('?') === -1; | ||
Object.keys(options).forEach((key) => { | ||
if (first) { | ||
loginUrl += '?'; | ||
first = false; | ||
} else { | ||
loginUrl += '&'; | ||
} | ||
loginUrl += `${encodeURIComponent(key)}=${encodeURIComponent(options[key])}`; | ||
}); | ||
|
||
// pop-up window size | ||
options.popupOptions = options.popupOptions || {}; | ||
const popupOptions = { | ||
width: options.popupOptions.width || 320, | ||
height: options.popupOptions.height || 450, | ||
}; | ||
|
||
OAuth.launchLogin({ | ||
loginService: 'hsl', | ||
loginStyle, | ||
loginUrl, | ||
credentialRequestCompleteCallback, | ||
credentialToken, | ||
popupOptions, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- Copyright 2018 Apinf Oy | ||
This file is covered by the EUPL license. | ||
You may obtain a copy of the licence at | ||
https://joinup.ec.europa.eu/community/eupl/og_page/european-union-public-licence-eupl-v11 --> | ||
|
||
<template name="configureLoginServiceDialogForHsl"> | ||
<p> | ||
You'll need to create an OpenID Connect client configuration with your provider (HSL). | ||
Set App Callbacks URLs to: <span class="url">{{siteUrl}}_oauth/hsl</span> | ||
</p> | ||
</template> |
Oops, something went wrong.