Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v3.7.1 #102

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
**Inštalačná príručka popisuje komponent verzie [3.7.0](https://github.com/slovensko-digital/slovensko-sk-api/releases/tag/v3.7.0), uistite sa, že čítate príručku [verzie komponentu](https://github.com/slovensko-digital/slovensko-sk-api/releases), ktorý používate.**
**Inštalačná príručka popisuje komponent verzie [3.7.1](https://github.com/slovensko-digital/slovensko-sk-api/releases/tag/v3.7.1), uistite sa, že čítate príručku [verzie komponentu](https://github.com/slovensko-digital/slovensko-sk-api/releases), ktorý používate.**

# slovensko.sk API - Inštalačná príručka

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/health_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def index
status = :ok
health = {
description: 'slovensko.sk API',
version: '3.7.0',
version: '3.7.1',
status: 'pass',
checks: {
'environment:variables' => environment_variables,
Expand Down
4 changes: 2 additions & 2 deletions app/services/edesk_message_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ def build_message_from_message_info(d, m)
end

def build_message_from_body(d, m)
raise ParseError if d.children.count > 1
raise ParseError if d.children.count { |node| node.name == 'MessageContainer' } > 1

d.children.each do |e|
case e.name
when 'MessageContainer'
build_message_from_message_container(e, m)
when 'InformationMessage'
when 'InformationMessage', 'MetadataContainer'
# skip
else
raise ParseError
Expand Down
2 changes: 1 addition & 1 deletion public/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ openapi: 3.0.0

info:
title: slovensko.sk API
version: 3.7.0 (Komunitná verzia) 8.8.0 (Prémium verzia)
version: 3.7.1 (Komunitná verzia) 8.8.1 (Prémium verzia)

description: |
slovensko.sk API je proxy REST API komponent k službám www.slovensko.sk (Ústredný portál verejnej správy – ÚPVS), pomocou ktorých je možné:
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion spec/requests/health_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def expect_fail(checks)
expect(response.status).to eq(200)
expect(response.object.with_indifferent_access).to match(
description: 'slovensko.sk API',
version: '3.7.0',
version: '3.7.1',
status: 'pass',
checks: hash_including(*checks),
links: {
Expand Down
66 changes: 66 additions & 0 deletions spec/services/edesk_message_parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,44 @@
)
end

it 'parses SkTalk structure even if body contains MetadataContainer' do
edesk_message = ekr_response('eks/get_message/class/egov_document_response_with_metadata_container.xml').get_message_result.value

message = subject.parse(edesk_message)

expect(message).to have_attributes(
id: 4906251507,
klass: 'EGOV_APPLICATION',
message_id: '95ccec13-7298-4e6b-8a08-5bb52a4e973b',
correlation_id: '95ccec13-7298-4e6b-8a08-5bb52a4e973b',
subject: 'Všeobecná agenda - rozhodnutie do vlastných rúk',
original_html: start_with('<!DOCTYPE html'),
original_xml: start_with('<SKTalkMessage'),
delivered_at: '2023-10-12T17:53:42.747+02:00'.to_time,
posp_id: 'Doc.GeneralAgendaReport',
posp_version: '1.4',
reference_id: '00000000-0000-0000-0000-000000000000',
sender_uri: 'ico://sk/83369225',
recipient_uri: 'rc://sk/8311577189_tisici_janko',
type: 'Doc.GeneralAgendaReport',
sender_business_reference: nil,
recipient_business_reference: nil,
objects: [
have_attributes(
id: '9c91d6c6-b271-483c-9823-1c665f24dad0',
name: 'Všeobecná agenda - Všeobecná agenda - rozhodnutie do vlastných rúk',
description: nil,
klass: 'FORM',
signed: true,
mime_type: 'application/vnd.etsi.asic-e+zip',
encoding: 'Base64'
)
],
delivery_notification: nil,
parse_error: nil
)
end

it 'parses delivery report notification message structure' do
edesk_message = ekr_response('eks/get_message/class/ed_delivery_notification_response.xml').get_message_result.value

Expand Down Expand Up @@ -160,6 +198,34 @@
)
end

it 'parses message structure with extra MessageContainer by marking it with parse error' do
edesk_message = ekr_response('eks/get_message/error/egov_document_response_with_two_message_containers.xml').get_message_result.value

message = subject.parse(edesk_message)

expect(message).to have_attributes(
id: 4906251507,
klass: 'EGOV_APPLICATION',
message_id: '95ccec13-7298-4e6b-8a08-5bb52a4e973b',
correlation_id: '95ccec13-7298-4e6b-8a08-5bb52a4e973b',
subject: 'Všeobecná agenda - rozhodnutie do vlastných rúk',
original_html: start_with('<!DOCTYPE html'),
original_xml: start_with('<SKTalkMessage'),
delivered_at: '2023-10-12T17:53:42.747+02:00'.to_time,
posp_id: 'Doc.GeneralAgendaReport',
posp_version: '1.4',
reference_id: '00000000-0000-0000-0000-000000000000',
sender_uri: nil,
recipient_uri: nil,
type: nil,
sender_business_reference: nil,
recipient_business_reference: nil,
objects: [],
delivery_notification: nil,
parse_error: kind_of(EdeskMessageParser::ParseError)
)
end

it 'parses unknown message structure by marking it with parse error' do
edesk_message = ekr_response('eks/get_message/class/ed_delivery_notification_response.xml').get_message_result.value

Expand Down
Loading