add new values for AccountConfiguration (#627)

Updates the AccountConfiguration command with options for 10.15.
Had to update protobuf to a newer version too.
This commit is contained in:
Victor Vrantchan
2019-11-26 15:01:49 -05:00
committed by GitHub
parent c0c5234cd9
commit ea393e9804
8 changed files with 2922 additions and 2652 deletions

4
go.mod
View File

@@ -9,8 +9,8 @@ require (
github.com/go-kit/kit v0.7.0
github.com/go-sql-driver/mysql v1.4.0 // indirect
github.com/go-stack/stack v1.7.0 // indirect
github.com/gogo/protobuf v1.0.0
github.com/golang/protobuf v1.2.0
github.com/gogo/protobuf v1.3.1
github.com/golang/protobuf v1.3.2
github.com/gorilla/context v1.1.1 // indirect
github.com/gorilla/mux v1.6.2
github.com/groob/finalizer v0.0.0-20170707115354-4c2ed49aabda

7
go.sum
View File

@@ -18,8 +18,12 @@ github.com/go-stack/stack v1.7.0 h1:S04+lLfST9FvL8dl4R31wVUC/paZp/WQZbLmUgWboGw=
github.com/go-stack/stack v1.7.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/gogo/protobuf v1.0.0 h1:2jyBKDKU/8v3v2xVR2PtiWQviFUyiaGk2rpfyFT8rTM=
github.com/gogo/protobuf v1.0.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls=
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/gorilla/context v0.0.0-20160226214623-1ea25387ff6f/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8=
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
@@ -34,6 +38,8 @@ github.com/groob/plist v0.0.0-20180203051248-dd56909aee38 h1:afbUddvIjPRC7XHHgeS
github.com/groob/plist v0.0.0-20180203051248-dd56909aee38/go.mod h1:qg2Nek0ND/hIr+nY8H1oVqEW2cLzVVNaAQ0QexOyjyc=
github.com/jmoiron/sqlx v0.0.0-20180614180643-0dae4fefe7c0 h1:5B0uxl2lzNRVkJVg+uGHxWtRt4C0Wjc6kJKo5XYx8xE=
github.com/jmoiron/sqlx v0.0.0-20180614180643-0dae4fefe7c0/go.mod h1:IiEW3SEiiErVyFdH8NTuWjSifiEQKUoyK3LNqr2kCHU=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kolide/kit v0.0.0-20180912215818-0c28f72eb2b0 h1:8UB0NJBoB/lN2O9zG9+U2klyYE0UhvN2Zrn7HBjhwNY=
github.com/kolide/kit v0.0.0-20180912215818-0c28f72eb2b0/go.mod h1:N3Yv8okDVC/5qZhPA9uxVYRfkp4mD2vrlQiSCWlNCpg=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY=
@@ -79,6 +85,7 @@ golang.org/x/sys v0.0.0-20180614134839-8883426083c0 h1:5mOaSPjCt3RW5w1KpSFOVg8Vd
golang.org/x/sys v0.0.0-20180614134839-8883426083c0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
google.golang.org/appengine v1.2.0 h1:S0iUepdCWODXRvtE+gcRDd15L+k+k1AiHlMiMjefH24=
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
gopkg.in/Masterminds/squirrel.v1 v1.0.0-20170825200431-a6b93000bd21 h1:GmGVIcDxdecAcVjcTp4IpK4VmCMxXhyZKwN2eIzsZ4Y=

View File

@@ -159,6 +159,10 @@ type InstallApplicationAttributes struct{}
type AccountConfiguration struct {
SkipPrimarySetupAccountCreation bool `plist:",omitempty" json:"skip_primary_setup_account_creation,omitempty"`
SetPrimarySetupAccountAsRegularUser bool `plist:",omitempty" json:"set_primary_setup_account_as_regular_user,omitempty"`
DontAutoPopulatePrimaryAccountInfo bool `plist:",omitempty" json:"dont_auto_populate_primary_account_info,omitempty"`
LockPrimaryAccountInfo bool `plist:",omitempty" json:"lock_primary_account_info,omitempty"`
PrimaryAccountFullName string `plist:",omitempty" json:"primary_account_full_name,omitempty"`
PrimaryAccountUserName string `plist:",omitempty" json:"primary_account_user_name,omitempty"`
AutoSetupAdminAccounts []AdminAccount `plist:",omitempty" json:"auto_setup_admin_accounts,omitempty"`
}

File diff suppressed because it is too large Load Diff

View File

@@ -219,6 +219,10 @@ message ValidateApplications {
message AccountConfiguration {
bool skip_primary_setup_account_creation = 1;
bool set_primary_setup_account_as_regular_user = 2;
bool dont_auto_populate_primary_account_info = 4;
bool lock_primary_account_info = 5;
string primary_account_full_name = 6;
string primary_account_user_name = 7;
repeated AutoSetupAdminAccounts auto_setup_admin_accounts = 3;
}

View File

@@ -200,6 +200,10 @@ func commandToProto(cmd *Command) (*mdmproto.Command, error) {
AccountConfiguration: &mdmproto.AccountConfiguration{
SkipPrimarySetupAccountCreation: cmd.AccountConfiguration.SkipPrimarySetupAccountCreation,
SetPrimarySetupAccountAsRegularUser: cmd.AccountConfiguration.SetPrimarySetupAccountAsRegularUser,
DontAutoPopulatePrimaryAccountInfo: cmd.AccountConfiguration.DontAutoPopulatePrimaryAccountInfo,
LockPrimaryAccountInfo: cmd.AccountConfiguration.LockPrimaryAccountInfo,
PrimaryAccountFullName: cmd.AccountConfiguration.PrimaryAccountFullName,
PrimaryAccountUserName: cmd.AccountConfiguration.PrimaryAccountUserName,
AutoSetupAdminAccounts: autosetupadminaccounts,
},
}

View File

@@ -170,6 +170,10 @@ func protoToCommand(pb *mdmproto.Command) *Command {
cmd.AccountConfiguration = &AccountConfiguration{
SkipPrimarySetupAccountCreation: pbc.GetSkipPrimarySetupAccountCreation(),
SetPrimarySetupAccountAsRegularUser: pbc.GetSetPrimarySetupAccountAsRegularUser(),
DontAutoPopulatePrimaryAccountInfo: pbc.GetDontAutoPopulatePrimaryAccountInfo(),
LockPrimaryAccountInfo: pbc.GetLockPrimaryAccountInfo(),
PrimaryAccountFullName: pbc.GetPrimaryAccountFullName(),
PrimaryAccountUserName: pbc.GetPrimaryAccountUserName(),
AutoSetupAdminAccounts: autosetupadminaccounts,
}
case "ApplyRedemptionCode":

View File

@@ -0,0 +1,24 @@
#!/bin/bash
# populate and lock the account info for the setup assistant.
# Example:
# ./tools/api/commands/account_configuration_populate_user $udid "Full Name" "username"
#
source $MICROMDM_ENV_PATH
endpoint="v1/commands"
jq -n \
--arg request_type "AccountConfiguration" \
--arg udid "$1" \
--arg fullname "$2" \
--arg username "$3" \
'.udid = $udid
|.skip_primary_setup_account_creation = false
|.set_primary_setup_account_as_regular_user = false
|.set_primary_setup_account_as_regular_user = false
|.dont_auto_populate_primary_account_info = false
|.lock_primary_account_info = true
|.primary_account_full_name = $fullname
|.primary_account_user_name = $username
|.request_type = $request_type
'|\
curl $CURL_OPTS -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@-