Skip to content
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

[AutoPR datafactory/resource-manager] Changed WebActivity and webhook activity auth to support both AKV and… #6089

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 60 additions & 2 deletions services/datafactory/mgmt/2018-06-01/datafactory/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -213504,15 +213504,73 @@ type WebActivityAuthentication struct {
// Type - Web activity authentication (Basic/ClientCertificate/MSI)
Type *string `json:"type,omitempty"`
// Pfx - Base64-encoded contents of a PFX file.
Pfx *SecureString `json:"pfx,omitempty"`
Pfx BasicSecretBase `json:"pfx,omitempty"`
// Username - Web activity authentication user name for basic authentication.
Username *string `json:"username,omitempty"`
// Password - Password for the PFX file or basic authentication.
Password *SecureString `json:"password,omitempty"`
Password BasicSecretBase `json:"password,omitempty"`
// Resource - Resource for which Azure Auth token will be requested when using MSI Authentication.
Resource *string `json:"resource,omitempty"`
}

// UnmarshalJSON is the custom unmarshaler for WebActivityAuthentication struct.
func (waa *WebActivityAuthentication) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
waa.Type = &typeVar
}
case "pfx":
if v != nil {
pfx, err := unmarshalBasicSecretBase(*v)
if err != nil {
return err
}
waa.Pfx = pfx
}
case "username":
if v != nil {
var username string
err = json.Unmarshal(*v, &username)
if err != nil {
return err
}
waa.Username = &username
}
case "password":
if v != nil {
password, err := unmarshalBasicSecretBase(*v)
if err != nil {
return err
}
waa.Password = password
}
case "resource":
if v != nil {
var resource string
err = json.Unmarshal(*v, &resource)
if err != nil {
return err
}
waa.Resource = &resource
}
}
}

return nil
}

// WebActivityTypeProperties web activity type properties.
type WebActivityTypeProperties struct {
// Method - Rest API method for target endpoint. Possible values include: 'WebActivityMethodGET', 'WebActivityMethodPOST', 'WebActivityMethodPUT', 'WebActivityMethodDELETE'
Expand Down