Skip to content

Commit f9ad3c7

Browse files
Merge pull request #3606 from apinf/develop
release 0.56.3 merge to master
2 parents 3f91932 + 43207bd commit f9ad3c7

File tree

26 files changed

+489
-97
lines changed

26 files changed

+489
-97
lines changed

.meteor/packages

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,4 @@ natestrauser:select2
9595
meteorhacks:aggregate
9696
apinf:api-umbrella
9797
apinf:accounts-admin-ui
98+
oauth

.meteor/versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ apinf:autoform-bs-datepicker@1.1.2
2323
apinf:bootstrap@3.3.7
2424
apinf:create-role-if-undefined@0.1.1
2525
apinf:first-admin@0.1.2
26-
apinf:fiware@0.1.3
26+
apinf:fiware@0.2.0
2727
apinf:restivus-swagger@0.4.0
2828
aramk:quill@0.1.1
2929
arillo:flow-router-helpers@0.5.2

.scripts/docker_build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
# Copyright 2017 Apinf Oy
3+
# Copyright 2018 Apinf Oy
44
#This file is covered by the EUPL license.
55
#You may obtain a copy of the licence at
66
#https://joinup.ec.europa.eu/community/eupl/og_page/european-union-public-licence-eupl-v11

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ services:
3030
- docker
3131

3232
before_install:
33+
- free -m
3334
- pwd
3435
- ls -la
3536
# Install meteor locally on CI

apinf_packages/about/client/about.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ <h3>
3333
Apinf
3434
</dt>
3535
<dd>
36-
0.56.0
36+
0.56.3
3737
</dd>
3838
<dt>
3939
API Umbrella
4040
</dt>
4141
<dd>
42-
0.15
42+
0.15.0-apinf2.1
4343
</dd>
4444
<dt>
4545
Version
@@ -134,7 +134,7 @@ <h3>
134134
{{_ "aboutApinf_contributors" }}
135135
</dt>
136136
<dd>
137-
Jawid Ahmadi, Taija Björklund, Vesa Härkönen, Nazia Hasan, Ville Jyrkkä, Matti Leppänen, Philippe Luickx, Ilari Mikkonen, Jarkko Moilanen, Alapan Mukherjee, Damir Mustafin, Sridevi Nittoor, Illya Nizyev, Yan Nunes, Brylie Christopher Oxley, Sebastian Pancia, Massimo Rangoni, Saransh Dev Singh, Shalva Usubov, Juuso Vallius, Sarala Vanipenta, Cassiano Vellames, Maurício Vieira, Daria Voytova
137+
Jawid Ahmadi, Taija Björklund, Vesa Härkönen, Nazia Hasan, Ville Jyrkkä, Matti Leppänen, Philippe Luickx, Ilari Mikkonen, Jarkko Moilanen, Alapan Mukherjee, Damir Mustafin, Sridevi Nittoor, Illya Nizyev, Yan Nunes, Brylie Christopher Oxley, Sebastian Pancia, Massimo Rangoni, Vinay Sanker, Saransh Dev Singh, Shalva Usubov, Juuso Vallius, Sarala Vanipenta, Cassiano Vellames, Maurício Vieira, Daria Voytova
138138
</dd>
139139
<dt>
140140
{{_ "aboutApinf_openSource" }}

apinf_packages/apis/client/lib/router.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,20 @@ FlowRouter.route('/apis/:slug/', {
4141
rel: 'alternate',
4242
type: 'application/rss+xml',
4343
href: `/rss/apis/?slug=${slug}`,
44-
title: `RSS Feed for ${api.name}`,
44+
// title: `RSS Feed for ${api.name}`,
4545
});
4646
}
4747

4848
// Set Social Meta Tags
4949
// Facebook & LinkedIn
5050
DocHead.addMeta({ property: 'og:image', content: api.logoUrl });
51-
DocHead.addMeta({ property: 'og:title', content: api.name });
52-
DocHead.addMeta({ property: 'og:description', content: api.description });
51+
// DocHead.addMeta({ property: 'og:title', content: api.name });
52+
// DocHead.addMeta({ property: 'og:description', content: api.description });
5353
DocHead.addMeta({ property: 'og:url', content: window.location.href });
5454
// Twitter
5555
DocHead.addMeta({ property: 'twitter:card', content: 'summary' });
56-
DocHead.addMeta({ property: 'twitter:title', content: api.name });
57-
DocHead.addMeta({ property: 'twitter:description', content: api.description });
56+
// DocHead.addMeta({ property: 'twitter:title', content: api.name });
57+
// DocHead.addMeta({ property: 'twitter:description', content: api.description });
5858
DocHead.addMeta({ property: 'twitter:image', content: api.logoUrl });
5959

6060
// Ensure current user has permissions to view backend

apinf_packages/apis/server/methods/status.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ https://joinup.ec.europa.eu/community/eupl/og_page/european-union-public-licence
55

66
// Meteor packages imports
77
import { Meteor } from 'meteor/meteor';
8-
import { check } from 'meteor/check';
8+
import { Match, check } from 'meteor/check';
99

1010
// Collection imports
1111
import Apis from '/apinf_packages/apis/collection';
@@ -18,18 +18,19 @@ Meteor.publish('getApiStatusRecordData', (apiId) => {
1818
const startDate = new Date();
1919
const lastDate = new Date();
2020
lastDate.setDate(lastDate.getDate() - 1);
21-
const query = { responses: { $elemMatch: { date: { $gte: startDate, $lte: lastDate } } } };
21+
const query = { responses: { $elemMatch: { date: { $gte: lastDate, $lte: startDate } } } };
2222
return MonitoringData.find({ apiId }, query);
2323
});
2424

2525
Meteor.methods({
26-
getApiStatus (apiId, url) {
26+
getApiStatus (apiId, url, endPoint) {
2727
// Make sure apiId is a string
2828
check(apiId, String);
29-
3029
// Make sure url is a string
3130
check(url, String);
32-
31+
// Make sure endPoint is a String
32+
// eslint-disable-next-line new-cap
33+
check(endPoint, Match.Maybe(String));
3334
// Call HTTP request
3435
Meteor.http.get(url, {}, (error, result) => {
3536
// Set status code
@@ -39,9 +40,9 @@ Meteor.methods({
3940
const monitoringData = {
4041
date: new Date(),
4142
server_status_code: serverStatusCode,
43+
end_point: endPoint,
4244
};
4345

44-
4546
// Update an api status
4647
Apis.update(apiId, { $set: { latestMonitoringStatusCode: serverStatusCode } });
4748

apinf_packages/core/helper_functions/validate_settings.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function githubSettingsValid (LoginPlatforms) {
2121
export function fiwareSettingsValid (LoginPlatforms) {
2222
// Verifies if LoginPlatforms exists and if it has the fiwareConfiguration property
2323
if ((typeof LoginPlatforms !== 'undefined') && LoginPlatforms.fiwareConfiguration) {
24-
// Assigns object referece to variable for better readability
24+
// Assigns object reference to variable for better readability
2525
const fiwareConfiguration = LoginPlatforms.fiwareConfiguration;
2626
// Verifies if fiwareConfiguration property has clientId, rootURL and secret
2727
if (fiwareConfiguration.clientId && fiwareConfiguration.secret && fiwareConfiguration.rootURL) {
@@ -33,6 +33,21 @@ export function fiwareSettingsValid (LoginPlatforms) {
3333
return false;
3434
}
3535

36+
// Validates OIDC configuration on LoginPlatforms
37+
export function oidcSettingsValid (LoginPlatforms) {
38+
// Verifies if LoginPlatforms exists and if it has the fiwareConfiguration property
39+
if ((typeof LoginPlatforms !== 'undefined') && LoginPlatforms.oidcConfiguration) {
40+
// Verifies if oidcConfiguration property has clientId and secret
41+
if (LoginPlatforms.oidcConfiguration.clientId &&
42+
LoginPlatforms.oidcConfiguration.secret) {
43+
// returns true if get to this point. It has all the required fields
44+
return true;
45+
}
46+
}
47+
// Returns false if LoginPlatforms does not have all the required fields
48+
return false;
49+
}
50+
3651
// Validates mail configuration settings
3752
export function mailSettingsValid (settings) {
3853
if ((typeof settings !== 'undefined') && settings.mail && settings.mail.enabled) {

apinf_packages/core/lib/i18n/en.i18n.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@
437437
"invalidEmailMessage": "Must be a valid e-mail address",
438438
"invalidProxyBasePathMessage": "Must begin and end with /. Allowed alphanumeric characters and -.?$*+'()/:#@!&,;=",
439439
"invalidApiBasePathMessage": "Must begin and end with /. Allowed alphanumeric characters and -.?$*+'()/:#@!&,;=",
440+
"invalidApiMonitoringEndpointMessage": "Must begin with /. Allowed alphanumeric characters and -.?$*+'()/:#@!&,;=",
440441
"invalidApiRequiredMessage": "Invalid input not allowed",
441442
"invalidContactPhoneMessage": "Must be a valid number. (0-9), +, -, space, / are allowed",
442443
"latestApiBackends_Heading": "Latest APIs",
@@ -1186,8 +1187,10 @@
11861187
"settings_mail_toEmail": "This email is used for receiving contact form submissions. It needs to be a valid, pre-existing, domain-specific email",
11871188
"settings_github": "Github",
11881189
"settings_fiware": "FIWARE",
1190+
"settings_hsl": "HSL",
11891191
"settings_save": "Save",
11901192
"settings_development_features": "Enable development features",
1193+
"settings_disabled_login_methods": "Disabled login methods",
11911194
"settings_sdkCode_generator": "SDK Code Generator",
11921195
"settings_successMessage": "Settings saved",
11931196
"settings_errorMessage": "Invalid Settings! Something is not right or a field is missing.",

apinf_packages/core/lib/simple_schema_config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ import {
1313
apiRequiredHeaderRegEx,
1414
proxyBasePathRegEx,
1515
} from '/apinf_packages/proxy_backends/collection/regex';
16+
import {
17+
apiMonitoringEndpointRegEx,
18+
apiEndPointRegEx,
19+
} from '/apinf_packages/monitoring/collection/lib/regex';
1620
import contactPhone from '/apinf_packages/organizations/collection/regex';
1721

1822
const invalidUrlMessage = TAPi18n.__('invalidUrlMessage');
@@ -23,6 +27,8 @@ const invalidProxyBasePathMessage = TAPi18n.__('invalidProxyBasePathMessage');
2327
const invalidApiBasePathMessage = TAPi18n.__('invalidApiBasePathMessage');
2428
const invalidApiRequiredMessage = TAPi18n.__('invalidApiRequiredMessage');
2529
const invalidContactPhoneMessage = TAPi18n.__('invalidContactPhoneMessage');
30+
const invalidApiMonitoringEndpointMessage = TAPi18n.__('invalidApiMonitoringEndpointMessage');
31+
const invalidApiEndpointMessage = TAPi18n.__('invalidApiEndpointMessage');
2632

2733
SimpleSchema.messages({
2834
regEx: [
@@ -35,5 +41,7 @@ SimpleSchema.messages({
3541
{ exp: apiBasePathRegEx, msg: invalidApiBasePathMessage },
3642
{ exp: apiRequiredHeaderRegEx, msg: invalidApiRequiredMessage },
3743
{ exp: contactPhone, msg: invalidContactPhoneMessage },
44+
{ exp: apiEndPointRegEx, msg: invalidApiEndpointMessage },
45+
{ exp: apiMonitoringEndpointRegEx, msg: invalidApiMonitoringEndpointMessage },
3846
],
3947
});

apinf_packages/login_platforms/client/login_platforms.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,21 @@ <h3 class="panel-title">
3737
{{> afQuickField name='githubConfiguration.secret' id="github-secret" }}
3838
</div>
3939
</div>
40+
<!--div class="panel panel-default">
41+
<div class="panel-heading">
42+
<h3 class="panel-title">
43+
{{_ "settings_hsl" }}
44+
</h3>
45+
</div>
46+
<div class="panel-body">
47+
{{> afQuickField name='hslConfiguration.clientId' id="hsl-id" }}
48+
{{> afQuickField name='hslConfiguration.secret' id="hsl-secret" }}
49+
{{> afQuickField name='hslConfiguration.serverUrl' id="hsl-server" }}
50+
{{> afQuickField name='hslConfiguration.authorizationEndpoint' id="hsl-authEp" }}
51+
{{> afQuickField name='hslConfiguration.tokenEndpoint' id="hsl-tokenEp" }}
52+
{{> afQuickField name='hslConfiguration.userinfoEndpoint' id="hsl-uInfoEp" }}
53+
</div>
54+
</div-->
4055
<div id="form-buttons">
4156
<button
4257
type="submit"

apinf_packages/login_platforms/client/login_platforms.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ import { Template } from 'meteor/templating';
99
// Meteor contributed packages imports
1010
import { DocHead } from 'meteor/kadira:dochead';
1111
import { TAPi18n } from 'meteor/tap:i18n';
12+
import { sAlert } from 'meteor/juliancwirko:s-alert';
13+
14+
// Meteor contributed packages imports
15+
import promisifyCall from '/apinf_packages/core/helper_functions/promisify_call';
1216

1317
// Collection imports
1418
import Branding from '/apinf_packages/branding/collection';
@@ -26,6 +30,26 @@ Template.loginPlatforms.onCreated(function () {
2630
DocHead.setTitle(`${branding.siteTitle} - ${pageTitle}`);
2731
}
2832
});
33+
// Check if there is some changes in Configuration
34+
// If there are, update the LoginPlatform
35+
promisifyCall('updateLoginPlatformsFromConfiguration')
36+
.then(result => {
37+
if (result) {
38+
// Get settings form success message translation
39+
const message = TAPi18n.__('settings_successMessage');
40+
// Alert the user of successful save
41+
sAlert.success(message);
42+
}
43+
})
44+
.catch(err => {
45+
if (err) {
46+
// Get settings form success message translation
47+
const message = TAPi18n.__('settings_errorMessage');
48+
// Alert the user of successful save
49+
sAlert.error(message, { timeout: 'none' });
50+
}
51+
});
52+
2953
// Subscription to feedback collection
3054
instance.subscribe('loginPlatforms');
3155
});

apinf_packages/login_platforms/collection/schema.js

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ LoginPlatforms.schema = new SimpleSchema({
1717
},
1818
'githubConfiguration.clientId': {
1919
type: String,
20-
optional: true,
20+
optional: false,
2121
autoform: {
2222
placeholder: 'xxx',
2323
},
2424
},
2525
'githubConfiguration.secret': {
2626
type: String,
27-
optional: true,
27+
optional: false,
2828
autoform: {
2929
placeholder: 'xxx',
3030
},
@@ -35,25 +35,71 @@ LoginPlatforms.schema = new SimpleSchema({
3535
},
3636
'fiwareConfiguration.clientId': {
3737
type: String,
38-
optional: true,
38+
optional: false,
3939
autoform: {
4040
placeholder: 'xxx',
4141
},
4242
},
4343
'fiwareConfiguration.secret': {
4444
type: String,
45-
optional: true,
45+
optional: false,
4646
autoform: {
4747
placeholder: 'xxx',
4848
},
4949
},
5050
'fiwareConfiguration.rootURL': {
5151
type: String,
52+
optional: false,
53+
autoform: {
54+
placeholder: 'xxx',
55+
},
56+
},
57+
hslConfiguration: {
58+
type: Object,
5259
optional: true,
60+
},
61+
'hslConfiguration.clientId': {
62+
type: String,
63+
optional: false,
64+
autoform: {
65+
placeholder: 'xxx',
66+
},
67+
},
68+
'hslConfiguration.secret': {
69+
type: String,
70+
optional: false,
5371
autoform: {
5472
placeholder: 'xxx',
5573
},
5674
},
75+
'hslConfiguration.serverUrl': {
76+
type: String,
77+
optional: false,
78+
autoform: {
79+
placeholder: 'https://secure-server.fi',
80+
},
81+
},
82+
'hslConfiguration.authorizationEndpoint': {
83+
type: String,
84+
optional: false,
85+
autoform: {
86+
placeholder: '/auth',
87+
},
88+
},
89+
'hslConfiguration.tokenEndpoint': {
90+
type: String,
91+
optional: false,
92+
autoform: {
93+
placeholder: '/token',
94+
},
95+
},
96+
'hslConfiguration.userinfoEndpoint': {
97+
type: String,
98+
optional: false,
99+
autoform: {
100+
placeholder: '/userInfo',
101+
},
102+
},
57103
});
58104

59105
// Enable translations (i18n)

0 commit comments

Comments
 (0)