Skip to content

Commit

Permalink
Merge pull request #1000 from rokwire/release/1.16.0
Browse files Browse the repository at this point in the history
Release/1.16.0
  • Loading branch information
sandeep-ps authored Aug 30, 2022
2 parents 53cab3e + 90bdf17 commit fcc5c6a
Show file tree
Hide file tree
Showing 16 changed files with 1,083 additions and 998 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ authservice/credentials.env

# Docker ENV files
.env
# Docker xml file
**.xml

# Python builds
*.egg-info/
Expand Down
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]


## [1.16.0] - 2022-08-29

### Added
- Ability to delete a capability or talent from contribution. [#951](https://github.com/rokwire/rokwire-building-blocks-api/issues/951)
- Hide sensitive data in capability view page. [#950](https://github.com/rokwire/rokwire-building-blocks-api/issues/950)
- Minimum user privacy level in talent form. [#970](https://github.com/rokwire/rokwire-building-blocks-api/issues/970)

### Security
- Upgrade Swagger UI base Docker image to v4.13.2. [#991](https://github.com/rokwire/rokwire-building-blocks-api/issues/991)

### Changed
- Change to allow all group admins to manage group events. [#996](https://github.com/rokwire/rokwire-building-blocks-api/issues/996)

### Fixed


## [1.15.0] - 2022-07-11
### Added
- Support in Contributions BB to upload an icon for Talents and Capabilities. [#945](https://github.com/rokwire/rokwire-building-blocks-api/issues/945)
Expand Down Expand Up @@ -501,7 +518,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed
- References to AWS keys and variables in the Events Building Block.

[Unreleased]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.15.1...HEAD
[Unreleased]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.16.0...HEAD
[1.16.0]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.15.0...1.16.0
[1.15.0]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.14.1...1.15.0
[1.14.1]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.14.0...1.14.1
[1.14.0]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.13.0...1.14.0
Expand Down
10 changes: 5 additions & 5 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/appconfigservice/ @minump

# Authentication Middleware Library
/lib/auth-middleware/ @ywkim312
/lib/auth-middleware/ @sandeep-ps

# API Doc
/Dockerfile @sandeep-ps
Expand All @@ -15,14 +15,14 @@
/eventservice/ @bingzhang

# Logging Building Block
/loggingservice/ @ywkim312
/loggingservice/ @sandeep-ps

# Profile Building Block
/profileservice/ @ywkim312
/profileservice/ @sandeep-ps

# Contributions Building Block
/contributions/* @ywkim312
/contributions/api/ @ywkim312
/contributions/* @minump
/contributions/api/ @minump

# Contributions Catalog
/contributions/catalog/ @minump
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM swaggerapi/swagger-ui:v3.28.0
FROM swaggerapi/swagger-ui:v4.13.2

COPY appconfigservice/appconfig.yaml /usr/share/nginx/html/app/
COPY authservice/auth.yaml /usr/share/nginx/html/app/
Expand All @@ -25,5 +25,3 @@ ENV URLS "[{url: 'app/appconfig.yaml', name: 'App Config Building Block'}, {url:
VOLUME /usr/share/nginx/html/app/

ENV BASE_URL="/docs"

CMD ["sh", "/usr/share/nginx/run.sh"]
1 change: 1 addition & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Patches for **Rokwire Building Blocks** in this repository will only be applied

| Version | Supported |
|----------| ------------------ |
| 1.16.0 | :white_check_mark: |
| 1.15.0 | :white_check_mark: |
| 1.14.1 | :white_check_mark: |
| 1.14.0 | :white_check_mark: |
Expand Down
4 changes: 2 additions & 2 deletions appconfigservice/appconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ openapi: 3.0.0
info:
title: Rokwire App Config Building Block API
description: App Config Building Block API Documentation
version: 1.15.0
version: 1.16.0
servers:
- url: https://api.rokwire.illinois.edu
description: Production server
Expand Down Expand Up @@ -310,4 +310,4 @@ components:
scheme: bearer
bearerFormat: JWT
x-bearerInfoFunc: auth_middleware.verify_core_token
description: The client must send a valid (i.e., signed, not expired) OpenID Connect id_token in the Authorization header including anonymous tokens
description: The client must send a valid (i.e., signed, not expired) OpenID Connect id_token in the Authorization header including anonymous tokens
42 changes: 22 additions & 20 deletions contributions/catalog/models/capability_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,27 @@ def to_capability(d):
capability_list = []

# check how many capabilities are in the given json
# this should be checked keys that is as surfix of _number
# this should be checked keys that is as suffix of _number
num_cap = 0
# if there is capability_name_0, it means that there is capability
if "capability_name_0" in d:
keys = list(d.keys())
cap_len = []
# if there is capability_name_{num}, it means that there is capability
capability_pattern = re.compile('capability_name_[0-9]')
keys = list(d.keys())
if any(capability_pattern.match(key) for key in keys):
cap_indexes = []
# iterate to count the number of capabilities
for key in keys:
key_splitted = key.split("capability_name_")
if len(key_splitted) > 1:
cap_len.append(int(key_splitted[1]))
num_cap = max(cap_len) + 1
cap_indexes.append(int(key_splitted[1]))
num_cap = len(cap_indexes)

# init capability
for _ in range(num_cap):
capability_list.append(init_capability())
for i, capability in enumerate(capability_list):
for ind, capability in enumerate(capability_list):
cap_id = str(uuid.uuid4())
capability['id'] = cap_id
i = cap_indexes[ind]
# get environment key value pairs by pattern matching.
# filter by matching with pattern environmentVariables_key_{{env_num}}_{{cap_num}}
key_pattern = re.compile('environmentVariables_key_[0-9]+' + '_' + str(i))
Expand All @@ -80,29 +82,29 @@ def to_capability(d):
for k, v in d.items():
if "isOpenSource_" + str(i) in k:
if v[0] == 'y':
capability_list[i]["isOpenSource"] = True
capability_list[ind]["isOpenSource"] = True
else:
capability_list[i]["isOpenSource"] = False
d[k][0] = capability_list[i]["isOpenSource"]
capability_list[ind]["isOpenSource"] = False
d[k][0] = capability_list[ind]["isOpenSource"]
elif "sourceRepoUrl_" + str(i) in k:
if capability_list[i]["isOpenSource"]:
capability_list[i]["sourceRepoUrl"] = v[0]
if capability_list[ind]["isOpenSource"]:
capability_list[ind]["sourceRepoUrl"] = v[0]
elif "deploymentDetails_" in k:
if ("_" + str(i)) in k:
name = (k.split("deploymentDetails_")[-1]).split('_' + str(i))[0]
capability_list[i]["deploymentDetails"][name] = v[0]
capability_list[ind]["deploymentDetails"][name] = v[0]
elif "dataDeletionEndpointDetails_" in k:
if ("_" + str(i)) in k:
name = (k.split("dataDeletionEndpointDetails_")[-1]).split('_' + str(i))[0]
capability_list[i]["dataDeletionEndpointDetails"][name] = v[0]
capability_list[ind]["dataDeletionEndpointDetails"][name] = v[0]
elif "capability_" in k:
if ("_" + str(i)) in k:
name = (k.split("capability_")[-1]).split('_' + str(i))[0]
if name in capability_list[i] and isinstance(capability_list[i][name], list) and len(v[0]) > 0:
capability_list[i][name].append(v[0])
elif name in capability_list[i] and isinstance(capability_list[i][name], list) and len(v[0]) == 0:
capability_list[i][name] = []
if name in capability_list[ind] and isinstance(capability_list[ind][name], list) and len(v[0]) > 0:
capability_list[ind][name].append(v[0])
elif name in capability_list[ind] and isinstance(capability_list[ind][name], list) and len(v[0]) == 0:
capability_list[ind][name] = []
else:
capability_list[i][name] = v[0]
capability_list[ind][name] = v[0]

return capability_list
43 changes: 22 additions & 21 deletions contributions/catalog/models/talent_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from datetime import date
import uuid
import json
import re

def init_talent():
d = {
Expand All @@ -39,28 +40,28 @@ def to_talent(d):
talent_list = []

# check how many capabilities are in the given json
# this should be checked keys that is as surfix of _number
# this should be checked keys that is as suffix of _number
num_tal = 0

# if there is talent_name_0, this means that there is talent
if 'talent_name_0' in d.keys():
keys = list(d.keys())
tal_len = []
# iterated talents to see how many talents are in there
# if there is capability_name_{num}, it means that there is capability
talent_pattern = re.compile('talent_name_[0-9]')
keys = list(d.keys())
if any(talent_pattern.match(key) for key in keys):
tal_indexes = []
# iterate to count the number of capabilities
for key in keys:
key_splitted = key.split("talent_name_")
if len(key_splitted) > 1:
tal_len.append(int(key_splitted[1]))
num_tal = max(tal_len) + 1
tal_indexes.append(int(key_splitted[1]))
num_tal = len(tal_indexes)

# init talent
# init capability
for _ in range(num_tal):
talent_list.append(init_talent())

for i, talent in enumerate(talent_list):
for ind, talent in enumerate(talent_list):
tal_id = str(uuid.uuid4())
talent['id'] = tal_id

i = tal_indexes[ind]
for k, v in d.items():
if "minUserPrivacyLevel_" in k:
if len(str(v[0])) > 0:
Expand All @@ -74,25 +75,25 @@ def to_talent(d):
# the items are only single item entry.
# However, required capabilities should be a list so it should be handled differently,
# and if there is any item that is a list, that should be handled separately.
if name in talent_list[i] and isinstance(talent_list[i][name], list) and len(v[0]) > 0:
if name in talent_list[ind] and isinstance(talent_list[ind][name], list) and len(v[0]) > 0:
if name == "requiredCapabilities":
for j in range(len(v)):
v[j] = reconstruct_required_capabilities(v[j])
talent_list[i][name].append(v[j])
talent_list[ind][name].append(v[j])
elif name == "requiredBuildingBlocks":
for j in range(len(v)):
talent_list[i][name].append(v[j])
talent_list[ind][name].append(v[j])
elif name == "minEndUserRoles":
for j in range(len(v)):
talent_list[i][name].append(v[j])
talent_list[ind][name].append(v[j])
else:
talent_list[i][name].append(v[i])
elif name in talent_list[i] and isinstance(talent_list[i][name], list) and len(v[0]) == 0:
talent_list[i][name] = []
talent_list[ind][name].append(v[i])
elif name in talent_list[ind] and isinstance(talent_list[ind][name], list) and len(v[0]) == 0:
talent_list[ind][name] = []
else:
talent_list[i][name] = v[0]
talent_list[ind][name] = v[0]

talent_list[i]["selfCertification"] = to_self_certification(d, i)
talent_list[ind]["selfCertification"] = to_self_certification(d, i)

return talent_list

Expand Down
5 changes: 4 additions & 1 deletion contributions/catalog/webapps/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -389,4 +389,7 @@ hr.dotted {
position: absolute;
margin-left: -20px;
margin-top: -20px;
}
}

.hidetext { -webkit-text-security: disc; }
.showtext { -webkit-text-security: none; }
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1" name="viewport">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
Expand Down Expand Up @@ -141,7 +142,14 @@ <h4>Deployment Details</h4>
<table>
{% for key,val in envvar.items() %}
<tr>
<td>{{key}}: {{val}}</td>
{% if loop.index %2 == 0 %}
<td>{{key}}: &#160 </td>
<td class="hidetext" style="text-align: center;"> {{val}}</td>
<td>&#160 &#160 <i class="bi bi-eye-slash field_icon" id="toggleText" style="cursor: pointer;"></i></td>
{% else %}
<td>{{key}}: </td>
<td>{{val}} </td>
{% endif %}
</tr>
{% endfor %}
</table>
Expand Down Expand Up @@ -191,7 +199,28 @@ <h4>Deployment Details</h4>
if (user_icon.style.display === '') {
document.getElementById("myDropdown").classList.toggle("show");
}
})
});

// toggle sensitive data visibility
$('.bi').each(function () {
let eye = $(this);
eye.on('click', function() {
let icon = $(this);
icon.toggleClass("bi-eye");
// get the current row
var current_row = icon.closest("tr");
// get the current row 2nd cell value
var $cell_value = current_row.find("td:eq(1)");
if (icon.hasClass('bi-eye')) {
$cell_value.removeClass("hidetext");
$cell_value.addClass("showtext");
}
else if (icon.hasClass('bi-eye-slash')) {
$cell_value.removeClass("showtext");
$cell_value.addClass("hidetext");
}
});
});
</script>
</body>
</html>
Loading

0 comments on commit fcc5c6a

Please sign in to comment.