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

Disable authentication check #42

Closed
dtslvr opened this issue Mar 5, 2019 · 3 comments
Closed

Disable authentication check #42

dtslvr opened this issue Mar 5, 2019 · 3 comments
Labels
enhancement New feature proposal
Milestone

Comments

@dtslvr
Copy link
Contributor

dtslvr commented Mar 5, 2019

As we are implementing our own authentication middleware, it would be great to disable the authentication check in @cubejs-backend/api-gateway.

I could imagine something like this:

import * as CubejsServerCore from "@cubejs-backend/server-core";

const config = {
  ...
  security: false
};
const core = CubejsServerCore.create(config);

What do you think?

@paveltiunov
Copy link
Member

@dtslvr I think it makes sense to add such behavior. The only thing: API gateway requires user context to get user info from. Probably the best way is to extract auth middleware which sets user context and let users override it.

@paveltiunov paveltiunov added the enhancement New feature proposal label Mar 5, 2019
@dtslvr
Copy link
Contributor Author

dtslvr commented Mar 6, 2019

@paveltiunov Yes, overriding sounds reasonable.

paveltiunov added a commit that referenced this issue Mar 14, 2019
@paveltiunov paveltiunov added this to the v0.4.1 milestone Mar 14, 2019
@dtslvr
Copy link
Contributor Author

dtslvr commented Mar 16, 2019

Great work! Now I can override it via

const config = {
  checkAuthMiddleware: (req, res, next) => {
    return next && next();
  }
};

CubejsServerCore.create(config);

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

No branches or pull requests

2 participants