-
Notifications
You must be signed in to change notification settings - Fork 1
Account provisioning support #40
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
Conversation
examples/wordpress.yml
Outdated
| vars: | ||
| username: "input.username" | ||
| email: "input.email" | ||
| password: "md5(credentials.password)" |
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.
md5 isn't actually a valid CEL method here, had this as an example.
pkg/bsql/user_syncer.go
Outdated
| Resource: accountResource, | ||
| } | ||
|
|
||
| return car, []*v2.PlaintextData{ptd}, nil, nil |
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.
If we are performing "no password" we shouldn't return plaintextData here. it can be an empty slice?
https://github.com/ConductorOne/baton-active-directory/blob/c433f970657570145c0e146e3b9ba8e420c21355/pkg/connector/users.go#L118
Here in AD we create an uninitialized var and just return it if we didn't generate it.
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.
I think I will add something similar and skip everything except no_password option for now
pkg/bsql/user_syncer.go
Outdated
| return nil, nil, nil, err | ||
| } | ||
|
|
||
| plainTextPassword, err := crypto.GeneratePassword(credentialOptions) |
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.
You might want to assert that the credentialOptions are infact no password
just until we actually implement it.
| func (t *Env) AccountProvisioningInputs(inputs map[string]any) (map[string]any, error) { | ||
| ret := make(map[string]any) | ||
|
|
||
| ret["input"] = inputs | ||
|
|
||
| return ret, nil | ||
| } |
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.
It's entirely possible that we're missing some functionality here. You can see other functions in this file evaluate some of these inputs as cel expressions. I'm not sure if that's something we want to do here, but this is where we'd do it I think
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.
I think we can skip this altogether because prepareSchemaVars handles the input
pkg/bsql/sql_syncer.go
Outdated
| if rt.Traits[0] == v2.ResourceType_TRAIT_USER { | ||
| rv = newUserSyncer(rt, rtConfig, db, dbEngine, celEnv, c) | ||
| } else { |
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.
the "rtConfig" object is a ResourceType and it should have a AccountProvisioning *AccountProvisioning you can check here. that's probably a better thing to do here
mj-palanker
left a comment
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.
YAY 🎉
Description
Bug fix
New feature
Add account provisioning support with no password configuration.
Useful links: