Skip to content

AMOS 2025 - API Endpoints #248

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

Merged
merged 157 commits into from
May 27, 2025
Merged

AMOS 2025 - API Endpoints #248

merged 157 commits into from
May 27, 2025

Conversation

ClProsser
Copy link
Contributor

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
feature

What is the current behavior?
Currently, there is no EMBArk API

What is the new behavior (if this is a feature change)?

We added:

  • API key generation (See My account -> User Menu)
    • Each API key is visible once.
    • If a new API key is generated, all previous API keys of this user get invalid.
  • API key test endpoint
    • Supports authentication using either the Authorization header or the api_key URL parameter
  • API uploader endpoint
    • Upload firmware and initiate scan
    • Returns scan uuid
  • API report status endpoint
    • Given a scan uuid, returns scan status
    • If the scan is finished, a report download link is returned
  • Github workflow to run django tests (Workflow django-tests)

Each endpoint is documented using the OpenAPI specification (Check openapi.yaml) and tested using integration tests.

Does this PR introduce a breaking change?
No

Other information:
This is the first release of the AMOS 2025 embark project.

jkunow and others added 30 commits April 24, 2025 23:52
Co-authored-by: ClProsser <[email protected]>
Signed-off-by: SirGankalot <[email protected]>
Co-authored-by: ClProsser <[email protected]>
Signed-off-by: SirGankalot <[email protected]>
Co-authored-by: SirGankalot <[email protected]>
Signed-off-by: ClProsser <[email protected]>
Co-authored-by: SirGankalot <[email protected]>
Signed-off-by: ClProsser <[email protected]>
Signed-off-by: ClProsser <[email protected]>
Signed-off-by: ClProsser <[email protected]>
Signed-off-by: ClProsser <[email protected]>
Signed-off-by: ClProsser <[email protected]>
LukaDeka and others added 18 commits May 19, 2025 21:14
Signed-off-by: Luka Dekanozishvili <[email protected]>
Signed-off-by: Luka Dekanozishvili <[email protected]>
Signed-off-by: Luka Dekanozishvili <[email protected]>
Signed-off-by: Luka Dekanozishvili <[email protected]>
added status_report integration tests
Co-authored by: Johannes Kunow <[email protected]>

Signed-off-by: Fridtjof Damm <[email protected]>
Co-authored by: Johannes Kunow <[email protected]>

Signed-off-by: Fridtjof Damm <[email protected]>
Signed-off-by: ashiven <[email protected]>
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you for contributing a pull request!

Welcome to the EMBA firmware analysis community!

We are glad you are here and appreciate your contribution. Please keep in mind our contributing guidelines here and here.
Also, please check existing open issues and consider to open a discussion in the dedicated discussion area.
Additionally, we have collected a lot of details around EMBArk, the installation and the usage of EMBArk in our Wiki.

If you like EMBA you have the chance to support us by becoming a Sponsor or buying some beer here.

This is an automatic message. Allow for time for the EMBA community to be able to read the pull request and comment on it.

@m-1-k-3 m-1-k-3 requested a review from Copilot May 25, 2025 12:08
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This feature PR adds new API endpoints for the AMOS 2025 EMBArk project including API key generation, firmware upload, status reporting, and associated integration tests and documentation updates. Key changes include:

  • Implementation of new API endpoints with proper authentication and status reporting.
  • Updates to UI templates and static assets for API key generation.
  • Enhancements to configuration, workflows, and tests to support the new functionality.

Reviewed Changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
embark/uploader/management/commands/test_runapscheduler.py Updated test case base class for transactional tests.
embark/tracker/tests.py Removed placeholder tracker tests.
embark/templates/user/index.html Integrated API key generation UI block.
embark/templates/user/apiKeyGen.html New template for API key generation with clipboard support.
embark/static/content/css/apiKeyGen.css Added CSS styling for the API key generation component.
embark/reporter/views.py Added API endpoint (status_report) with new authentication and zip generation logic.
embark/reporter/urls.py Registered the new status_report endpoint.
embark/reporter/tests.py Added integration tests covering the new endpoints.
embark/porter/tests.py Entire file content commented out, potentially reducing test coverage.
embark/entrypoint.sh Updated migration command to include the porter app.
embark/embark/tests/test_linecache.py All tests commented out, affecting test coverage.
embark/embark/test_logreader.py Minor adjustments with new skipIf decorator added.
embark/embark/settings/dev.py & deploy.py Updated authors and added rest_framework to installed apps.
dev-tools/check_project.sh, .spectral.yaml, .github/workflows/* Added and updated linting and CI test configuration files.
emba Updated subproject commit reference.
Comments suppressed due to low confidence (2)

embark/porter/tests.py:1

  • Consider re-enabling or cleaning up the commented test code to ensure the porter functionality is adequately covered by tests.
All test content commented out in this file

embark/embark/tests/test_linecache.py:1

  • Re-enable the test cases or remove the commented code to maintain proper test coverage for the line cache functionality.
All test content commented out in this file

@m-1-k-3 m-1-k-3 added enhancement New feature or request EMBArk labels May 26, 2025
Copy link
Member

@BenediktMKuehne BenediktMKuehne left a comment

Choose a reason for hiding this comment

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

Love it
Just the copyright headers have to be corrected

@ClProsser ClProsser requested a review from BenediktMKuehne May 26, 2025 22:35
@m-1-k-3 m-1-k-3 added the AMOS label May 27, 2025
@BenediktMKuehne BenediktMKuehne merged commit 268c1c4 into e-m-b-a:main May 27, 2025
7 checks passed
@BenediktMKuehne
Copy link
Member

Great work everyone 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AMOS EMBArk enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants