-
Notifications
You must be signed in to change notification settings - Fork 37
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
feat(rest)!: upgrade to credo 0.5 #256
feat(rest)!: upgrade to credo 0.5 #256
Conversation
Also siwtches the rest package to use indy-vdr and anoncreds packages Tests are currently passing but 2 suites fail due to a cleanup issue that still needs to be resolved There are also several TODO items that should be reviewed Signed-off-by: Matthew Dean <[email protected]>
Signed-off-by: Matthew Dean <[email protected]>
Signed-off-by: Matthew Dean <[email protected]>
Signed-off-by: Matthew Dean <[email protected]>
1. refactored module instantiation to a helper function 2. configured correct types to support v1 and v2 credential and proof protocols and correct formats 3. proof controller updated to take parameters like agent 4. re-enabled oob proof api as create-request Signed-off-by: Matthew Dean <[email protected]>
Signed-off-by: Matthew Dean <[email protected]>
Signed-off-by: Matthew Dean <[email protected]>
Signed-off-by: Timo Glastra <[email protected]>
Signed-off-by: Timo Glastra <[email protected]>
Signed-off-by: Timo Glastra <[email protected]>
Signed-off-by: Timo Glastra <[email protected]>
Signed-off-by: Timo Glastra <[email protected]>
Signed-off-by: Timo Glastra <[email protected]>
Signed-off-by: Timo Glastra <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #256 +/- ##
===========================================
- Coverage 86.78% 62.28% -24.51%
===========================================
Files 24 79 +55
Lines 1241 1832 +591
Branches 270 375 +105
===========================================
+ Hits 1077 1141 +64
- Misses 164 635 +471
- Partials 0 56 +56 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Timo Glastra <[email protected]>
Signed-off-by: Timo Glastra <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing blocking at all! Really nice changes. Looks like keeping the API up-to-date and adding new features was quite a lot for this PR, but with the current structure it seems quite easy to do, nice!
|
||
if (options.multiTenant) { | ||
modules.tenants = new TenantsModule({ | ||
sessionLimit: Infinity, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats very scalable! wonder what happens when you exceed f32::MAX sessions :').
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah the session implementation is a bit broken in Credo, I want to address it for 0.6, as it counts very weird so it's not a good indication of how much resources you're using
multiTenant?: boolean | ||
}): Promise<RestRootAgent | RestRootAgentWithTenants> => { | ||
// FIXME: logger should not be enabled by default | ||
const logger = new TsLogger(LogLevel.off) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this be possible to set with the start script? with something like -vvv
for loglevel=3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we can do it for the CLI part already --log-level. I need to improve the non-cli (import rest server) api a bit. Will look at it in my next PR if okay
import type { ApiError } from '../types' | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
export function alternativeResponse<T>(input: T): any { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
T
can be return type as well right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No as then the return type on the method is wrong. This is my workaround to have alternative responses in TSOA. The proper way to do it (inject error handler) doesn't allow you to set examples for alternative status codes.
This way the OpenAPI / swagger is nice, which is most important to me
packages/rest/tsconfig.build.json
Outdated
@@ -2,7 +2,9 @@ | |||
"extends": "../../tsconfig.build.json", | |||
"compilerOptions": { | |||
"outDir": "./build", | |||
"types": [] | |||
"types": [], | |||
"skipLibCheck": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats already set in the abse tsconfig right?
Signed-off-by: Timo Glastra <[email protected]>
Signed-off-by: Timo Glastra <[email protected]>
Signed-off-by: Timo Glastra <[email protected]>
Signed-off-by: Timo Glastra <[email protected]>
Updates the rest API wrapper to Credo 0.5, based on #222. It upgrade to use Aries Askar, Indy VDR and AnonCreds RS, and In addition it also adds support for multi-tenancy.
A follow up PR will add documentation, an easy to run docker image, as well as openid4vc support.
Co-authored-by: Matthew Dean [email protected]
Signed-off-by: Matthew Dean [email protected]
Signed-off-by: Timo Glastra [email protected]