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

FIX: Update to work with the rewritten API #38

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
12 changes: 12 additions & 0 deletions ansible/debian_based.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
update-cache: yes
pkg:
- gpg
- name: Proceed configuring user
debconf:
name: intelmq
question: intelmq-api/setup
value: "True"
vtype: boolean
- name: Set user for IntelMQ API
debconf:
name: intelmq-api
Expand All @@ -24,6 +30,12 @@
question: intelmq-api/password-repeat
value: asdf
vtype: password
- name: Agree to configure the DB
debconf:
name: intelmq
question: intelmq-api/dbconfig-install
value: "True"
vtype: boolean
- name: Set webserver service name
set_fact:
webserver: apache2
Expand Down
1 change: 1 addition & 0 deletions ansible/tasks/api/00_registerauth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
body:
username: admin
password: asdf
follow_redirects: all
register: auth
2 changes: 1 addition & 1 deletion ansible/tasks/api/01_checkauth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
register: queuesnoauth
- name: Check if authentication works
assert:
that: "'{\"errors\": {\"Authentication Required\": \"Please provide valid Token verification credentials\"}}' in queuesnoauth.content"
that: "'{\"error\":{\"Authentication Required\":\"Please provide valid Token verification credentials\"}}' in queuesnoauth.content"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the response changed, that indicates a breaking change.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unfortunately true, but I didn't find any troubles with the IntelMQ Manager so far. But it needs to be verified one more time.

There are unfortunately some disadvantages of how hug works:

  1. the errors key in messages on auth error were set by hug; the rest of the API is using error (I assume the idea was to follow the same key, but it failed);
  2. hug was returning the proper JSON response, but... without setting the proper content-type header. IntelMQ Manager handles well both versions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for checking all the details! I agree it's OK to go with the change then, but it should be mentioned in the CHANGELOG of intelmq-api