Skip to content

Conversation

@jirwin
Copy link
Contributor

@jirwin jirwin commented Mar 13, 2025

Description

  • Bug fix

  • New feature

  • Add account provisioning support with no password configuration.

Screenshot 2025-03-25 at 11 42 24 AM

Useful links:

vars:
username: "input.username"
email: "input.email"
password: "md5(credentials.password)"
Copy link
Contributor Author

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.

Resource: accountResource,
}

return car, []*v2.PlaintextData{ptd}, nil, nil

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.

Copy link
Contributor

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

return nil, nil, nil, err
}

plainTextPassword, err := crypto.GeneratePassword(credentialOptions)

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.

Comment on lines +165 to +171
func (t *Env) AccountProvisioningInputs(inputs map[string]any) (map[string]any, error) {
ret := make(map[string]any)

ret["input"] = inputs

return ret, nil
}

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

Copy link
Contributor

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

Comment on lines 45 to 47
if rt.Traits[0] == v2.ResourceType_TRAIT_USER {
rv = newUserSyncer(rt, rtConfig, db, dbEngine, celEnv, c)
} else {

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

Copy link

@mj-palanker mj-palanker left a comment

Choose a reason for hiding this comment

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

YAY 🎉

@bemafisher1 bemafisher1 marked this pull request as ready for review March 26, 2025 00:11
@bemafisher1 bemafisher1 merged commit 3f74811 into main Mar 26, 2025
2 checks passed
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.

4 participants