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

Error when no parameter exists #3

Closed
samchon opened this issue Feb 15, 2021 · 4 comments
Closed

Error when no parameter exists #3

samchon opened this issue Feb 15, 2021 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@samchon
Copy link
Owner

samchon commented Feb 15, 2021

When declaring a controller method that has not any parameter, it becomes an error.

import * as helper from "encrypted-nestjs";
import * as nest from "@nestjs/common";

@nest.Controller("bbs/articles")
export class BbsArticleController
{
    @helper.EncryptedRoute.Get()
    public async index(): Promise<IPage<IBbsArticle.ISummary>>;
}
@samchon samchon added the bug Something isn't working label Feb 15, 2021
@samchon samchon self-assigned this Feb 15, 2021
@PrimeDominus
Copy link

I've looked at https://github.com/samchon/encrypted-nestjs and I'm wondering why not just use the documented method for encryption coded into Nestia directly? https://docs.nestjs.com/security/encryption-and-hashing

I'm relatively new to NestJS, though I'm guessing Nestia would be more widely used if it doesn't have custom dependencies that give the impression they may not be maintained in the future.

@PrimeDominus
Copy link

Furthermore, another custom library https://www.npmjs.com/package/encrypted-fetcher is used as a further dependency, which in turn uses node-fetch. Why not code all this directly into Nestia using the official way? https://docs.nestjs.com/techniques/http-module

@samchon
Copy link
Owner Author

samchon commented Feb 15, 2021

The example code you've pasted in (https://docs.nestjs.com/security/encryption-and-hashing) is just to explain how to encrypt and decrypt data. Therefore, encryption decorators like EncryptedBody() in the encrypted-nestjs is not natively supported by the NestJS.

Also, the way to encrypt & decrypt data in the encrypted-fetcher is not ultimately different with the explanation what you've pasted in.

@samchon
Copy link
Owner Author

samchon commented Feb 15, 2021

And you told that using axios is the official way, however, I've different aspect about that. I think that fetch is much official feature within framework of the standardardization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants