adduser

package
v0.0.0-...-1aaa49d Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Adduser functions.UaaAddUserFunc = func(info functions.UserInfo) (userId string, err error) {
	fmt.Println(fmt.Sprintf("add user id: %s .........", info.User.Uid))
	emails := make([]Email, 0)
	for _, value := range info.User.Emails {
		email := Email{
			Value: value,
		}
		emails = append(emails, email)
	}
	userRequest := UserRequest{
		UserName:   info.User.Uid,
		Externalid: info.User.Externalid,
		Emails:     emails,
		Origin:     info.Origin,
	}
	data, err := json.Marshal(userRequest)
	if err != nil {
		return
	}
	body := bytes.NewBuffer(data)
	response, err := info.RequestFn(info.Token, fmt.Sprintf("%s/Users", info.Uaaurl), "POST", "application/json", body)
	if err != nil {
		return
	}
	return parse(response)
}
View Source
var NewRoundTripper = func() http.RoundTripper {
	return &http.Transport{
		TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
	}
}

Functions

This section is empty.

Types

type Email

type Email struct {
	Value string `json:"value"`
}

type UserCreateResponse

type UserCreateResponse struct {
	Id string
}

type UserRequest

type UserRequest struct {
	UserName   string  `json:"userName"`
	Emails     []Email `json:"emails"`
	Origin     string  `json:"origin"`
	Externalid string  `json:"externalid"`
}

Jump to

Keyboard shortcuts

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