Skip to content

feat: restructure to allow usage in other mode projects#269

Merged
simllll merged 2 commits intosimllll:masterfrom
123FLO321:br_module
Apr 6, 2022
Merged

feat: restructure to allow usage in other mode projects#269
simllll merged 2 commits intosimllll:masterfrom
123FLO321:br_module

Conversation

@123FLO321
Copy link
Copy Markdown
Contributor

@123FLO321 123FLO321 commented Apr 4, 2022

  • move code from app.ts into RadiusServer.ts
  • replace logging with a logger specified via the RadiusServer options
  • export RadiusServer and associated types

This allows this module to be used in other node projects:

   public async onModuleInit(): Promise<void> {
        if (this.secret && this.tlsOptions) {
            const radiusServer = new RadiusServer({
                logger: this.logger,
                secret: this.secret,
                port: this.port,
                address: this.hostname,
                tlsOptions: this.tlsOptions,
                authentication: this
            });
            await radiusServer.start();
        } else {
            this.logger.log("Not Starting Radius Server because RADIUS_SECRET is not set");
        }
    }

- move code from app.ts into RadiusServer.ts
- replace logging with a logger specified via the RadiusServer options
- export RadiusServer and associated types
and make some server options optional
@123FLO321
Copy link
Copy Markdown
Contributor Author

Side note: this package.json indicates GPLv3 as license but the repo doesn’t actually include any licenses.
Can we add one?

dns[index] = entry.object.dn;
});
});

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Looks clean to me :) thanks, i will do one finale check before approving regarding the cli command, but if this works, then its good to go :) thanks for refactoring

@simllll simllll merged commit 341e9d2 into simllll:master Apr 6, 2022
@simllll
Copy link
Copy Markdown
Owner

simllll commented Apr 6, 2022

Thanks for your contribution!

@simllll
Copy link
Copy Markdown
Owner

simllll commented Apr 7, 2022

releassed as major 2.x release, but I also converted it to an ESM package.

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.

2 participants