-
Notifications
You must be signed in to change notification settings - Fork 667
Do not use user config team id for template build command #811
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
base: main
Are you sure you want to change the base?
Conversation
…rived from acess token
|
|
yes, i updated the test description, do you mind testing on your machine for due diligence? thx |
how does it know what team to upload the template to if the team id is not provided? |
it derives it from the access token |
But if it's a different one in the template.toml? Will it still be using my default team? |
Down the backend call stack of the handler for the request made here in the CLI client code, this is what determines the team ID, in other words it seems like no team ID is used. /infra/packages/api/internal/handlers/auth.go func (a *APIStore) GetUserAndTeams(c *gin.Context) (*uuid.UUID, []queries.GetTeamsWithUsersTeamsWithTierRow, error) {
userID := a.GetUserID(c)
ctx := c.Request.Context()
teams, err := a.sqlcDB.GetTeamsWithUsersTeamsWithTier(ctx, userID)
if err != nil {
return nil, nil, fmt.Errorf("error when getting default team: %w", err)
}
return &userID, teams, err
} |
Yeah but the problem here it will always use the default team id or the one supplied as a parameter but will ignore e2b.toml? |
it also picks up the team id from e2b.toml |
/infra/packages/api/internal/handlers/auth.go The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
This won't work if you have access to the template, but it isn't in your default team. It would require changes on backend (and it would probably make sense to check if ANY team you are part of has access to the template)
-
If you don't use it, you don't need to save the team id
Description
The team ID is derived from the provided access token for this specific command, this PR lets you still explicitly specify the team id via opts but does not take it from the user config to avoid unwanted team does not exist errors when specifying access tokens for different clusters.
Test