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: glee auth v2 #474

Merged
merged 71 commits into from
Aug 21, 2023
Merged

feat: glee auth v2 #474

merged 71 commits into from
Aug 21, 2023

Conversation

oviecodes
Copy link
Contributor

Description
This PR continues the discussion on the glee authentication issue #377 , it continues the discussion about glee authentication, from #460 .

Following the idea from @Souvikns to use a separate directory for authentication. Each file in this directory can hold both server and client authentication logic.

/** auth/serverName.ts **/

export function serverAuth({headers, done}) {
  // write logic for authentication 
  done()
}

export function clientAuth() {
  return {
    username: '',
    password: ''
  }
}

Steps to test run authentication

  • In the glee root directory, cd examples/anime-http/server,
  • The server directory, contains an auth directory that holds a trendingAnimeServer.ts file. The file contains some logic you can edit how you like but it must export the same functions as the code above
  • npm run dev to start the server in dev mode
  • The same logic applies to the client directory, cd examples/anime-http/server
  • Then look for auth/trendingAnime.js update accordingly then start the server.

Related issue(s)
Resolves #377

@Souvikns @KhudaDad414

@oviecodes oviecodes changed the title Glee auth v2 feat: glee auth v2 Jul 10, 2023
Copy link
Member

@KhudaDad414 KhudaDad414 left a comment

Choose a reason for hiding this comment

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

left some comments.

src/lib/userAuth.ts Outdated Show resolved Hide resolved
examples/anime-http/server/auth/trendingAnimeServer.ts Outdated Show resolved Hide resolved
examples/anime-http/server/asyncapi.yaml Outdated Show resolved Hide resolved
examples/anime-http/server/asyncapi.yaml Show resolved Hide resolved
examples/anime-http/server/asyncapi.yaml Show resolved Hide resolved
src/lib/userAuth.ts Outdated Show resolved Hide resolved
src/lib/userAuth.ts Show resolved Hide resolved
src/lib/index.d.ts Outdated Show resolved Hide resolved
src/lib/adapter.ts Outdated Show resolved Hide resolved
src/adapters/ws/server.ts Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Jul 27, 2023

Pull Request Test Coverage Report for Build 5799719460

Warning: This coverage report may be inaccurate.

We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report.
To ensure accuracy in future PRs, please see these guidelines.
A quick fix for this PR: rebase it; your next report should be accurate.

  • 4 of 10 (40.0%) changed or added relevant lines in 2 files are covered.
  • 6 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-1.1%) to 59.433%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/lib/adapter.ts 4 6 66.67%
src/lib/configs.ts 0 4 0.0%
Files with Coverage Reduction New Missed Lines %
src/lib/configs.ts 2 16.5%
src/lib/glee.ts 4 90.36%
Totals Coverage Status
Change from base Build 5463620227: -1.1%
Covered Lines: 332
Relevant Lines: 470

💛 - Coveralls

@oviecodes oviecodes mentioned this pull request Aug 16, 2023
Copy link
Member

@KhudaDad414 KhudaDad414 left a comment

Choose a reason for hiding this comment

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

LGTM!

@sonarcloud
Copy link

sonarcloud bot commented Aug 21, 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
1.9% 1.9% Duplication

Copy link
Member

@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.

Looks good 👍🏼, you can merge it when you are ready.

@oviecodes
Copy link
Contributor Author

Looks good 👍🏼, you can merge it when you are ready.

Merging is blocked on my end... @Souvikns

@oviecodes
Copy link
Contributor Author

/rtm

@asyncapi-bot asyncapi-bot merged commit f761154 into asyncapi:master Aug 21, 2023
12 checks passed
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 0.26.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Souvikns
Copy link
Member

@allcontributors please add @oviecodes for code

@allcontributors
Copy link
Contributor

@Souvikns

I've updated the pull request to add @oviecodes! 🎉

@KhudaDad414
Copy link
Member

@allcontributors please add @oviecodes for code

Copy link
Contributor

@KhudaDad414

I've put up a pull request to add @oviecodes! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants