Skip to content

Commit cf7d317

Browse files
Merge pull request apinf#3702 from apinf/hack/tenant-mock
Hack/tenant mock
2 parents 0893282 + c7a1b6e commit cf7d317

File tree

30 files changed

+2647
-199
lines changed

30 files changed

+2647
-199
lines changed

.meteor/packages

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ useraccounts:bootstrap
8686
useraccounts:core
8787
useraccounts:flow-routing
8888
vsivsi:file-collection
89-
zimme:active-route
89+
zimme:active-route@2.3.2
9090
aldeed:autoform-select2
9191
natestrauser:select2
9292
meteorhacks:aggregate
@@ -96,6 +96,6 @@ cleandersonlobo:mdi-icons
9696
yasaricli:textcounter
9797
oauth@1.2.6
9898

99-
underscore
99+
underscore@1.0.10
100100
kurounin:pagination
101101
kurounin:pagination-blaze@=1.0.6

.meteor/versions

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ accounts-github@1.4.2
33
accounts-oauth@1.1.16
44
accounts-password@1.5.1
55
accounts-ui@1.3.1
6-
accounts-ui-unstyled@1.4.2
6+
accounts-ui-unstyled@1.4.1
77
alanning:roles@1.2.16
88
aldeed:autoform@5.8.1
99
aldeed:autoform-bs-button-group-input@1.0.3
@@ -57,7 +57,7 @@ ddp-server@2.2.0
5757
deepwell:bootstrap-datepicker2@1.3.0
5858
deps@1.0.12
5959
diff-sequence@1.1.1
60-
dynamic-import@0.5.1
60+
dynamic-import@0.5.0
6161
ecmascript@0.12.4
6262
ecmascript-runtime@0.7.0
6363
ecmascript-runtime-client@0.8.0
@@ -78,7 +78,7 @@ harrison:papa-parse@1.1.7
7878
hot-code-push@1.0.4
7979
html-tools@1.0.11
8080
htmljs@1.0.11
81-
http@1.4.2
81+
http@1.4.1
8282
id-map@1.1.0
8383
inter-process-messaging@0.1.0
8484
jquery@1.11.11
@@ -114,15 +114,15 @@ modules@0.13.0
114114
modules-runtime@0.10.3
115115
momentjs:moment@2.24.0
116116
mongo@1.6.0
117-
mongo-decimal@0.1.0
117+
mongo-decimal@0.1.1
118118
mongo-dev-server@1.1.0
119119
mongo-id@1.0.7
120120
mongo-livedata@1.0.12
121121
natestrauser:select2@4.0.3
122122
nimble:restivus@0.8.11
123123
npm-bcrypt@0.9.3
124124
npm-mongo@3.1.1
125-
oauth@1.2.7
125+
oauth@1.2.6
126126
oauth2@1.2.1
127127
observe-sequence@1.0.16
128128
olragon:uri-js@1.13.1
@@ -144,7 +144,7 @@ reactive-dict@1.2.1
144144
reactive-var@1.0.11
145145
reload@1.2.0
146146
retry@1.1.0
147-
reywood:publish-composite@1.7.0
147+
reywood:publish-composite@1.5.2
148148
routepolicy@1.1.0
149149
sacha:spin@2.3.1
150150
service-configuration@1.0.11
@@ -179,7 +179,7 @@ useraccounts:bootstrap@1.14.2
179179
useraccounts:core@1.14.2
180180
useraccounts:flow-routing@1.14.2
181181
vsivsi:file-collection@1.3.5
182-
webapp@1.7.2
182+
webapp@1.7.1
183183
webapp-hashing@1.0.9
184184
yasaricli:textcounter@0.0.1
185185
zimme:active-route@2.3.2

apinf_packages/core/client/navbar/navbar.html

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
{{/ if }}
2323
</div>
2424
<ul class="nav navbar-nav" id="main-navbar">
25+
<!-- Dashboard -->
2526
{{# if currentUser }}
2627
{{# if proxyIsDefined }}
2728
{{# if userCanViewDashboard }}
@@ -33,23 +34,40 @@
3334
{{/ if }}
3435
{{/ if }}
3536
{{/ if }}
37+
38+
<!-- MQTT Dashboard -->
3639
{{# if userCanViewMqttDashboard }}
3740
<li class="{{ isActiveRoute 'mqtt' }} main-links">
3841
<a href="{{ pathFor 'mqtt' }}" id="mqtt-button">
3942
{{_ "navbar_mqttDashboard" }}
4043
</a>
4144
</li>
4245
{{/ if }}
43-
<li class="{{ isActiveRoute 'apiCatalog' }} main-links">
44-
<a href="{{ pathFor 'apiCatalog' }}" id="apis-button">
45-
{{_ "navbar_apis" }}
46-
</a>
47-
</li>
48-
<li class="{{ isActiveRoute 'organizationCatalog' }} main-links">
49-
<a href="{{ pathFor 'organizationCatalog' }}" id="organizations-button">
50-
{{_ "navbar_organizations" }}
46+
47+
<!-- API catalog -->
48+
<li class="{{ isActiveRoute 'apiCatalog' }} main-links">
49+
<a href="{{ pathFor 'apiCatalog' }}" id="apis-button">
50+
{{_ "navbar_apis" }}
51+
</a>
52+
</li>
53+
54+
<!-- Organizations -->
55+
<li class="{{ isActiveRoute 'organizationCatalog' }} main-links">
56+
<a href="{{ pathFor 'organizationCatalog' }}" id="organizations-button">
57+
{{_ "navbar_organizations" }}
58+
</a>
59+
</li>
60+
61+
<!-- Tenants -->
62+
<!-- TODO tenant: Show only in case user has logged in via Keyrock -->
63+
{{# if canManageTenants }}
64+
<li class="{{ isActiveRoute 'tenantCatalog' }} main-links">
65+
<a href="{{ pathFor 'tenantCatalog' }}" id="tenants-button">
66+
Tenants
5167
</a>
5268
</li>
69+
{{/ if }}
70+
5371
{{# if currentUser }}
5472
{{# if userCanAddApi }}
5573
<li class="{{ isActiveRoute 'addApi' }} main-links">
@@ -59,6 +77,7 @@
5977
</li>
6078
{{/ if }}
6179

80+
<!-- Users management -->
6281
{{# if isInRole 'admin' }}
6382
<li class="{{ isActiveRoute 'accountsAdmin' }} main-links">
6483
<a href="{{ pathFor 'accountsAdmin' }}" id="users-button">
@@ -67,6 +86,8 @@
6786
</li>
6887
{{/ if }}
6988
{{/ if }}
89+
90+
<!-- Pricing block -->
7091
{{# if homeCustomBlock }}
7192
<li class="{{ isActiveRoute 'pricing' }} main-links">
7293
<a href="{{ pathFor 'pricing' }}" id="pricing-button">
@@ -75,6 +96,8 @@
7596
</a>
7697
</li>
7798
{{/ if }}
99+
100+
<!-- Configuration of site -->
78101
{{# if isInRole 'admin' }}
79102
<li class="mobile-links-only hide-link">
80103
<a href="{{ pathFor 'branding' }}" id="branding-button">
@@ -97,6 +120,8 @@
97120
</a>
98121
</li>
99122
{{/ if }}
123+
124+
<!-- User own menu -->
100125
{{# if currentUser }}
101126
<li class="mobile-links-only hide-link">
102127
<a href="{{ pathFor 'profile' }}" id="profile-button">

apinf_packages/core/client/navbar/navbar.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,16 @@ Template.navbar.helpers({
135135
currentUser () {
136136
return Meteor.user();
137137
},
138+
canManageTenants () {
139+
// Get user id
140+
const userId = Meteor.userId();
141+
const user = Meteor.users.findOne(userId);
142+
143+
if (user && user.services && user.services.fiware) {
144+
return true;
145+
}
146+
return false;
147+
},
138148
userCanViewMqttDashboard () {
139149
// Get current user Id
140150
const userId = Meteor.userId();

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

Lines changed: 84 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,8 @@
449449
"emailTemplates_verifyEmail_title": "Verify Your Email Address",
450450
"emailVerification_successMessage": "Email verified! Thanks!",
451451
"emqProxyForm_acl_title": "Access Control Rules",
452+
"ensureTenantRemovalForm_button_cancel_title": "Cancel operation",
453+
"ensureTenantRemovalForm_button_remove_title": "Remove this Tenant",
452454
"entityComment_cancelComment": "Cancel",
453455
"entityComment_deleteComment": "Delete",
454456
"entityComment_replyComment": "Reply",
@@ -539,6 +541,14 @@
539541
"importOpenApiSpecification_optionText_url": "URL",
540542
"importOpenApiSpecification_optionText_firstOption": "Select lifecycle status",
541543
"importOpenApiSpecificationUploadButton_buttonText_file": "Choose file",
544+
"informTenantUser_emailSubject_tenantAddition": "New tenant added: __tenant__",
545+
"informTenantUser_emailSubject_tenantRemoval": "Tenant __tenant__ removed",
546+
"informTenantUser_emailSubject_userRemoval": "User removed from tenant __tenant__",
547+
"informTenantUser_emailSubject_userRoleChange": "Changes in user roles in tenant __tenant__",
548+
"informTenantUser_emailText_roleInfo": "Current roles: ",
549+
"informTenantUser_emailText_tenantRemoval": "Tenant __tenant__ is removed. One of the users was: ",
550+
"informTenantUser_emailText_userRemoval": "Changes in tenant __tenant__. Removed following user: ",
551+
"informTenantUser_emailText_userRoleChange": "In the tenant __tenant__, there are changes in roles of following user: ",
542552
"invalidApiBasePathMessage": "Must begin and end with /. Allowed alphanumeric characters and -.?$*+'()/:#@!&,;=",
543553
"invalidApiMonitoringEndpointMessage": "Must begin with /. Allowed alphanumeric characters and -.?$*+'()/:#@!&,;=",
544554
"invalidApiRequiredMessage": "Invalid input not allowed",
@@ -1366,23 +1376,24 @@
13661376
"searchPage_searchForm_helpText": "Start typing your query for live search results.",
13671377
"searchPage_searchForm_placeholderText": "Start typing to search APIs...",
13681378
"searchPage_searchResultsHeader": "Search results",
1369-
"settings_panelTitle_addingApisAndOrganizations": "Adding APIs and Organizations",
1370-
"settings_mail": "Mail",
1371-
"settings_mail_fromEmail": "This email is used to validate email addresses used for user registration and contact form submission. It needs to be a valid, pre-existing, domain-specific email",
1372-
"settings_mail_toEmail": "This email is used for receiving contact form submissions. It needs to be a valid, pre-existing, domain-specific email",
1373-
"settings_github": "Github",
1374-
"settings_fiware": "FIWARE",
1375-
"settings_hsl": "HSL",
1376-
"settings_save": "Save",
13771379
"settings_development_features": "Enable development features",
13781380
"settings_disabled_login_methods": "Disabled login methods",
13791381
"settings_disabled_login_methods_caution": "Caution!",
13801382
"settings_disabled_login_methods_caution_text": "It is possible to lock-out users with this selection, including Admins!",
13811383
"settings_disabled_login_methods_caution_warning_1": "Do not disable all login methods!",
13821384
"settings_disabled_login_methods_caution_warning_2": "Make sure that there is at least one Admin user left capable to use some of allowed login methods!",
1383-
"settings_sdkCode_generator": "SDK Code Generator",
13841385
"settings_errorMessage": "Invalid Settings! Something is not right or a field is missing.",
1386+
"settings_fiware": "FIWARE",
1387+
"settings_github": "Github",
1388+
"settings_hsl": "HSL",
1389+
"settings_mail": "Mail",
1390+
"settings_mail_fromEmail": "This email is used to validate email addresses used for user registration and contact form submission. It needs to be a valid, pre-existing, domain-specific email",
1391+
"settings_mail_toEmail": "This email is used for receiving contact form submissions. It needs to be a valid, pre-existing, domain-specific email",
1392+
"settings_panelTitle_addingApisAndOrganizations": "Adding APIs and Organizations",
1393+
"settings_save": "Save",
1394+
"settings_sdkCode_generator": "SDK Code Generator",
13851395
"settings_successMessage": "Settings saved",
1396+
"settings_tenant": "Tenant Manager",
13861397
"settings_title_supportsGraphql": "API Umbrella proxy supports GraphQL requests",
13871398
"settingsPage_title": "General",
13881399
"settingsPage_title_settings": "Settings",
@@ -1421,6 +1432,70 @@
14211432
"updatePassword_submitButton_text": "Change Password",
14221433
"updatePasswordForm_successMessage": "Password updated.",
14231434
"passwordsMismatch": "Passwords do not match",
1435+
"tenantAuthorization_title": "Tenant Authorization",
1436+
"tenantAuthorization_button_refresh": "Refresh now",
1437+
"tenantCatalog_buttonText_addTenant": "Add Tenant",
1438+
"tenantCatalog_Title": "Tenants",
1439+
"tenantCatalog_toolbar_filterOptions_myOrganizations": "My tenants",
1440+
"tenantCatalog_toolbar_authorization": "Authorization",
1441+
"tenantCatalogPage_title_organizationsCatalog": "Tenant Catalog",
1442+
"tenantCatalogPage_token_title": "Authorization token is needed in Tenant related requests",
1443+
"tenantCatalogPage_token_details_1": "User must have an account on Tenant Manager",
1444+
"tenantCatalogPage_token_details_2": "While logging in using Keyrock, User receives an authentication token, here: ",
1445+
"tenantCatalogPage_token_details_2b": "Note! Expiration time: ",
1446+
"tenantCatalogPage_token_details_2c": "You need to sign out and sign in again to get valid authentication token!",
1447+
"tenantCatalogPage_token_details_3": "User receives also a refresh token, here: ",
1448+
"tenantCatalogTable_button_edit": "Edit tenant",
1449+
"tenantCatalogTable_button_edit_title": "Edit this tenant, change Name, Description, Users and their Roles",
1450+
"tenantCatalogTable_button_remove": "Remove tenant",
1451+
"tenantCatalogTable_button_remove_title": "Remove this Tenant",
1452+
"tenantCatalogTable_header_tenants": "Tenants",
1453+
"tenantCatalogTable_header_username": "Username & Roles",
1454+
"tenantCatalogTable_row_title_username": "Username",
1455+
"tenantCatalogTable_row_title_roles": "Roles",
1456+
"tenantCatalogTable_row_title_consumer": "Consumer",
1457+
"tenantCatalogTable_row_title_provider": "Provider",
1458+
"tenantCatalogTable_header_action": "Action",
1459+
"tenantForm_addTenant_Success_Message": "Tenant added successfully: ",
1460+
"tenantForm_addTenant_error_Message": "Tenant operation failed! ",
1461+
"tenantForm_addTenant_failure_Message": "Tenant manager error! Returns code ",
1462+
"tenantForm_addTenant_notify_error": "Error in notifying users",
1463+
"tenantForm_button_cancel": "No, cancel",
1464+
"tenantForm_button_cancel_title": "Cancel this operation",
1465+
"tenantForm_button_save_title": "Save new Tenant",
1466+
"tenantForm_button_modify_title": "Save Tenant modifications",
1467+
"tenantForm_update_Failure_Message": "Tenant update failed! ",
1468+
"tenantForm_update_error_Message": "Tenant update failed! ",
1469+
"tenantForm_update_check_error_Message": "Tenant user check failed! Refresh Tenant list and try again! ",
1470+
"tenantForm_modifyButton_text": "Yes, Modify Tenant",
1471+
"tenantForm_saveButton_text": "Yes, Add Tenant",
1472+
"tenantForm_tenant_noName_error": "Tenant must have a name!",
1473+
"tenantForm_tenant_noDescription_error": "Tenant must have a description!",
1474+
"tenantForm_title_add": "Add new Tenant",
1475+
"tenantForm_title_modify": "Modify Tenant",
1476+
"tenantForm_tenantDescription": "Tenant description",
1477+
"tenantForm_tenantName": "Tenant name",
1478+
"tenantForm_id_missing_Message": "Problem! Tenants id is missing!",
1479+
"tenantForm_noChanges_Message": "No changes in Tenant",
1480+
"tenantForm_tokenExpiredWarning_message": "Authorization token is expired. Sign out and sign in again to refresh the token!",
1481+
"tenantForm_removal_Success_Message": "Tenant removed successfully: ",
1482+
"tenantForm_update_Success_Message": "Tenant updated successfully: ",
1483+
"tenantRemoveForm_button_remove": "Yes, remove Tenant",
1484+
"tenantRemoveForm_question": "Are you sure you want to remove this tenant?",
1485+
"tenantRemoveForm_title": "Tenant removal",
1486+
"tenantRequest_missingBasepath": "Tenant Manager basepath is missing from Settings",
1487+
"tenantRequest_missingTenantList": "Tenant list fetch failed! ",
1488+
"tenantRequest_missingUserlist": "Userlist fetch failed! ",
1489+
"tenantUserForm_addButton_text": "Add user for Tenant",
1490+
"tenantUserForm_errorTextUserNotSelected": "No User is selected for addition!",
1491+
"tenantUserForm_errorTextDuplicateUser": "This user already exists on Tenants user list: ",
1492+
"tenantUserForm_help_addUser": "Select user and give roles",
1493+
"tenantUserForm_title_addUser": "Add a new user for tenant",
1494+
"tenantUserForm_button_addUser_title": "Add selected user to Tenant's user list",
1495+
"tenantUsersList_title": "Users of this tenant",
1496+
"tenantUsersList_thead_username": "Username",
1497+
"tenantUsersList_thead_roles": "Roles",
1498+
"tenantUsers_button_title_removeUser": "Remove this user from Tenant",
14241499
"uploadApiLogoButton": "Upload logo",
14251500
"uploadApiLogo_confirm_delete": "Are you sure you want to delete this logo?",
14261501
"uploadApiLogo_successfully_deleted": "Logo successfully deleted!",

apinf_packages/organizations/client/catalog/catalog.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,11 @@ Template.organizationCatalog.helpers({
131131
gridViewMode () {
132132
// Get view mode from template
133133
const viewMode = FlowRouter.getQueryParam('viewMode');
134-
135134
return (viewMode === 'grid');
136135
},
137136
tableViewMode () {
138137
// Get view mode from template
139138
const viewMode = FlowRouter.getQueryParam('viewMode');
140-
141139
return (viewMode === 'table');
142140
},
143141
userCanAddOrganization () {

apinf_packages/settings/client/settings.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ <h2>{{_ "settingsPage_title" }}</h2>
1616
{{> afQuickField name='access.onlyAdminsCanAddApis' id="addapi-adminonly" }}
1717
{{> afQuickField name='access.onlyAdminsCanAddOrganizations' id="addorganization-adminonly" }}
1818
{{> afQuickField name='developmentFeatures' id="development-features" }}
19+
20+
<!-- GraphQL settings -->
1921
<div class="panel panel-default">
2022
<div class="panel-heading">
2123
<span class="panel-title">
@@ -26,6 +28,8 @@ <h2>{{_ "settingsPage_title" }}</h2>
2628
</span>
2729
</div>
2830
</div>
31+
32+
<!-- SDK Code Generator settings -->
2933
<div class="panel panel-default">
3034
<div class="panel-heading">
3135
<span class="panel-title">
@@ -44,6 +48,7 @@ <h2>{{_ "settingsPage_title" }}</h2>
4448
{{/ if }}
4549
</div>
4650

51+
<!-- Mail settings -->
4752
<div class="panel panel-default">
4853
<div class="panel-heading">
4954
<span class="panel-title">
@@ -113,6 +118,23 @@ <h2>{{_ "settingsPage_title" }}</h2>
113118
</div>
114119
</div>
115120

121+
<!-- Tenant settings -->
122+
<div class="panel panel-default">
123+
<div class="panel-heading">
124+
<span class="panel-title">
125+
{{_ "settings_tenant" }}
126+
</span>
127+
<span class="pull-right">
128+
{{> afQuickField name='tenantIdm.enabled' id="tenantIdm" }}
129+
</span>
130+
</div>
131+
{{# if afFieldValueIs name='tenantIdm.enabled' value=true }}
132+
<div class="panel-body">
133+
{{> afQuickField name='tenantIdm.url_and_basepath' id="tenantIdm-basepath" }}
134+
</div>
135+
{{/ if }}
136+
</div>
137+
116138
<!-- Save settings -->
117139
<button
118140
type="submit"

0 commit comments

Comments
 (0)