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

adapter.http: implement attachment routes #257

Conversation

Frosty2500
Copy link
Contributor

No description provided.

list werkzeug as a dependency in the readme
adapter.http: add custom identifier converter for werkzeug
adapter.http: restructure routing map, add first submodel route
adapter.http: refine imports
adapter._generic: add identifier URI encode/decode functions
adapter.http: make api routes return ResponseData instead of the Response directly
adapter.http: add Result + Message types + factory function
adapter.http: add request body parsing
adapter.http: implement all remaining aas routes
- use stripped object serialization/deserialization
- change response format (new spec always returns a result object)
adapter.http: remove old routes, add a few new aas and submodel routes
using the werkzeug.routing.MapAdapter url builder
Requests to URIs with a trailing slash will now be redirected
to the respective URI without trailing slash.
e.g. GET /aas/$identifier/ -> GET /aas/$identifier

A redirect will only be set if the respective URI without trailing slash
exists and the current request method is valid for the new URI.

Historically, the trailing slash was only present when the requested
resource was a directory. In our case the resources don't work like
directories, in the sense, that each resource doesn't even list possible
subsequent resources. So because our resources don't behave like
directories, they shouldn't have a trailing slash.
to stay consistent with the rest of this library
add IdShortPathConverter and helper functions
change type check from `not A is B` to `A is not B` for better readability
… attributes

like statement, annotation and value
jkhsjdhjs and others added 29 commits March 20, 2024 16:01
adapter.http: implement submodel repo routes
The route now uses the submodel identifier instead of the submodel
reference.
adapter.http: change `base64url_encode()` function to return `str`
…s_routes

adapter.http: update AAS submodel refs path and `DELETE` route
adapter.http: suffix slashes to all routes
The submodel routes of the AAS API `/shells/<aas_id>/submodels` are the
same already implemented as the submodel API, so we return a redirect
here, after checking that the AAS indeed has a reference to the
requested submodel.

`PUT` and `DELETE` are different, as we also have to update the AAS in
this case, either by adding a new updated reference in case of a `PUT`
request changes the submodel id, or by removing the submodel reference
for `DELETE` requests.
adapter.http: implement AAS API submodel routes via redirects
…routes_to_submount

adapter.http: move `asset-information` routes to a submount
The `IdentifierConverter` is also used to decode values from URLs, that
aren't necessarily Identifiers, e.g. Qualifier types. Thus, a name like
`Base64URLConverter` suits its use better and is also more expressive.

For the same reasons, the key `identifier`, which was used for the
`IdentifierConverter`, is renamed to `base64url`.
adapter.http: rename `IdentifierConverter` to `Base64URLConverter`
Methods `_get_shell()` and `_get_shells()` are added similarly to
`_get_submodel()` and `_get_submodels()`, which were previously added in
ffb833b.

Furthermore, when requesting multiple AAS/Submodels, we're now also
updating these in `_get_all_obj_of_type()` before returning them.
Finally, updating AAS/Submodel objects is also moved to `_get_obj_ts()`.
@Frosty2500 Frosty2500 closed this Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants