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

feat: new config format and parser #485

Closed
wants to merge 2 commits into from

Conversation

Souvikns
Copy link
Member

@Souvikns Souvikns commented Aug 1, 2023

Description

Since we are moving the client auth from the config file to auth folder we need to update our config file format and update the parser as well to fetch these data differently.

This PR is trying to achieve two things:

  • New format for the config file (also the requirements for the config file now that auth parameters are removed)
  • Update the config file parsing logic according the the new format

Related issue(s)

Fixes #392

@sonarcloud
Copy link

sonarcloud bot commented Aug 1, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Member Author

@Souvikns Souvikns left a comment

Choose a reason for hiding this comment

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

@KhudaDad414 I am trying to change the format for the config-file now that the auth parameters are being removed.

Comment on lines 18 to 25
export default async function () {
return {
glee: {},
kafka: {},
websocket: {},
mqtt: {},
cluster: {},
http: {}
docs: {},
server: {},
cluster: {}
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This was the old format for glee-config and it was done to configure WebSocket servers for socket-io or pass in a custom server object. So building on that I am trying to add a new object named server where we would pass in the custom server config. The parser would take a server name from the spec and see if any config exists in the config file and then load that accordingly.

Copy link
Member

Choose a reason for hiding this comment

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

It looks good, the only thing that worries me a little about this approach is writing an interface for it. I mean we want type suggestion/safety on the file right? with server name as a key I am not sure how we can write protocol specific interfaces. 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we can still achieve that, I am not sure but I used notion API which had something like this kind of type

interface T {
  server: {
    [name:string]: {
      httpAdapter: any,
      adapter: string,
      port: number
    }
  }
}

Copy link
Member Author

Choose a reason for hiding this comment

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

@KhudaDad414 can I move ahead with this?

Copy link
Member

Choose a reason for hiding this comment

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

yeah, If type can be checked then let's do this. 👍

Copy link
Contributor

github-actions bot commented Dec 8, 2023

This pull request has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 120 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation.

There can be many reasons why some specific pull request has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this pull request forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

@github-actions github-actions bot added the stale label Dec 8, 2023
@KhudaDad414
Copy link
Member

@Souvikns what are we going to do with this? 🤔

@github-actions github-actions bot removed the stale label Jan 13, 2024
@Souvikns
Copy link
Member Author

Since the config file has changed a lot, I am closing this and will open a new PR.

@Souvikns Souvikns closed this Mar 21, 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.

Better config management
2 participants