adminmgmt

package
v0.0.0-...-0490640 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAdminUserToTeam

func AddAdminUserToTeam(ctx context.Context,
	apiClient client.APIClient, adminsTeamID, userID string, dryRun bool) (bool, error)

AddAdminUserToTeam adds the admin user to the admins team by its ID, unless the admin is already in the team. It returns a boolean representing whether or not the user needed to be added.

func CreateAdminTeamIfMissing

func CreateAdminTeamIfMissing(ctx context.Context,
	apiClient client.APIClient, dryRun bool) (string, bool, error)

CreateAdminTeamIfMissing creates the admins team if it is missing. It returns the team ID in either case and a boolean for if it was found or created.

func CreateAdminUserOrUpdatePassword

func CreateAdminUserOrUpdatePassword(ctx context.Context,
	apiClient client.APIClient, newAdminPassword string, dryRun bool) (string, bool, error)

CreateAdminUserOrUpdatePassword either creates a new admin user or updates the existing users password. In either case, it should return the ID and a boolean representing whether the user was found or created.

func EnsureTeam

func EnsureTeam(ctx context.Context,
	id, description string,
	apiClient client.APIClient,
	dryRun bool) (string, bool, error)

EnsureTeam creates the desired team if it is missing, and returns the team's ID, together with a boolean indicating if the team was created by this call

func UpdateV1AdminsPolicyIfNeeded

func UpdateV1AdminsPolicyIfNeeded(ctx context.Context,
	apiClient client.APIClient, dryRun bool) (bool, bool, error)

UpdateV1AdminsPolicyIfNeeded either creates a new admins policy if one doesn't exist anymore or creates a new admin policy with the admins team as a subject

if the admins team is not already a subject.

It returns two booleans: one representing if the original policy was found and the other representing if a new policy was created.

func UpdateV2AdminsPolicyIfNeeded

func UpdateV2AdminsPolicyIfNeeded(ctx context.Context,
	apiClient client.APIClient, dryRun bool) (bool, error)

UpdateV2AdminsPolicyIfNeeded fetches the chef-managed Admin policy's members and adds the admins team if it's missing from that list

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL