-
Notifications
You must be signed in to change notification settings - Fork 409
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
Automatically add CAN_MANAGE
permission on databricks_sql_endpoint
for calling user
#2168
Conversation
CAN_MANAGE
permission to databricks_sql_endpoint
permissionCAN_MANAGE
permission to databricks_sql_endpoint
permission
Why is this handled different from clusters? Why not add |
@mkazia-db because our API is not consistent |
permissions/resource_permissions.go
Outdated
return err | ||
} | ||
if strings.HasPrefix(objectID, "/sql/warehouses") { | ||
warehouse, err := w.Warehouses.GetById(a.context, strings.ReplaceAll(objectID, "/sql/warehouses/", "")) |
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.
for debuggability, could you extract strings.ReplaceAll(objectID, "/sql/warehouses/", "")
to a variable?
permissions/resource_permissions.go
Outdated
} | ||
// add CAN_MANAGE permission for creator | ||
objectACL.AccessControlList = append(objectACL.AccessControlList, AccessControlChange{ | ||
UserName: warehouse.CreatorName, |
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.
will it work if it's a service principal? check azure-prod
env
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.
our API accepts service principal as UserName fine...which is the cause of #2131
fa81de6
to
1bcb165
Compare
@mkazia-db Adding warehouse @nfx when I tested this further, automatically adding permission to the warehouse creator results in permanent diff (as the extra permission is returned in the API). For now I'll apply the quick fix, and handle that extra edge case properly |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #2168 +/- ##
==========================================
- Coverage 88.77% 88.74% -0.03%
==========================================
Files 137 137
Lines 11211 11217 +6
==========================================
+ Hits 9953 9955 +2
- Misses 851 853 +2
- Partials 407 409 +2
|
CAN_MANAGE
permission to databricks_sql_endpoint
permissionCAN_MANAGE
permission on databricks_sql_endpoint
for calling user
acceptance tests passed |
Changes
CAN_MANAGE
permission for calling user todatabricks_sql_endpoint
closes [ISSUE] Issue withdatabricks_permissions
resource ondatabricks_sql_endpoint
#2165databricks_permissions
to use Go SDKTests
make test
run locallydocs/
folderinternal/acceptance