Skip to content

Execute as #3

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

Merged
merged 1 commit into from
Mar 18, 2020
Merged

Execute as #3

merged 1 commit into from
Mar 18, 2020

Conversation

mpenick
Copy link
Contributor

@mpenick mpenick commented Mar 17, 2020

No description provided.

@mpenick mpenick changed the base branch from master to prototype March 17, 2020 20:49
@mpenick
Copy link
Contributor Author

mpenick commented Mar 17, 2020

Not tested yet. Two things I'm left wondering about:

  • Should we doing method chaining instead of a parameter? (We could wrap gocql.Query)
  • Should we have a configuration flag for "execute as is enabled" and return an error if the context variable isn't set? Or is expecting it to be there from a HandlerFunc middleware callback enough?

@mpenick mpenick mentioned this pull request Mar 17, 2020
@jorgebay
Copy link
Contributor

Should we doing method chaining instead of a parameter?

We could use a struct for parameters, that way we can group them into a single type.

@jorgebay
Copy link
Contributor

Good idea to tap into the Context interface 👍

Should we have a configuration flag for "execute as is enabled" and return an error

I'm +1 on this approach, in order to make sure we are executing as expected by the api consumer.

Feel free to merge when you feel is ready and leave any further improvements for other commits.

db/db_session.go Outdated
Comment on lines 55 to 56
payload := make(map[string][]byte)
payload["ProxyExecute"] = []byte(userOrRole)
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: we can use map literal syntax.

@mpenick mpenick merged commit 449eaf9 into prototype Mar 18, 2020
@mpenick mpenick deleted the execute-as branch April 24, 2020 13:29
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