eclipse-thingweb / eclipse-thingweb/node-wot

Falling back to nosec security if scheme is unknown

Open
#1,563 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
192
Forks
100
Avg merge
3d 2h
Merged PRs (30d)
6

Description

PR https://github.com/eclipse-thingweb/node-wot/pull/1552 raised a concern about security schemes we don't understand. We used to silently ignore them in some cases.

If we use a security schema `foo` we don't know, like

```
"securityDefinitions": {
"nosecIOT": {
"scheme": "foo"
}
}
```

node-wot raises an error like `TD validation error: must be equal to one of the allowed values`.
This is fine as is!

However, if we prefix it (e.g., `iot:nosecXYZ`), we simply log a warning.

```
"securityDefinitions": {
"nosecIOT": {
"scheme": "iot:nosecXYZ"
}
}
```

`HttpClient cannot set security scheme 'iot:nosecXYZ'`

Some questions that come to my mind
* Shall we look into that and raise an error for unknown schemes? What is the best way of doing that across bindings?
* What about the exposing part?
* Is this also a topic for the Scripting API?

Contributor guide

Open the contributing guide

Research direction

Start by reading PR 1552 and reproducing both securityDefinitions examples from this issue: the unprefixed unknown scheme and the prefixed iot:nosecXYZ scheme. Trace where the warning and validation error originate across bindings, then determine the expected behavior for consuming, exposing, and Scripting API paths. Done means the handling of unknown schemes is agreed and consistently covered across the affected paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, typescript
Domain
backend-api-design, security
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.