| 46 | import org.apache.commons.validator.routines.EmailValidator; |
| 47 | |
| 48 | public class InitAdminUser implements InitStep { |
| 49 | private final InitFlags flags; |
| 50 | private final ConsoleUI ui; |
| 51 | private final AccountsOnInit accounts; |
| 52 | private final VersionedAuthorizedKeysOnInit.Factory authorizedKeysFactory; |
| 53 | private final VersionedAuthTokensOnInit.Factory tokenFactory; |
| 54 | private final ExternalIdsOnInit externalIds; |
| 55 | private final SequencesOnInit sequencesOnInit; |
| 56 | private final GroupsOnInit groupsOnInit; |
| 57 | private final ExternalIdFactory externalIdFactory; |
| 58 | private AccountIndexCollection accountIndexCollection; |
| 59 | private GroupIndexCollection groupIndexCollection; |
| 60 | |
| 61 | @Inject |
| 62 | InitAdminUser( |
| 63 | InitFlags flags, |
| 64 | ConsoleUI ui, |
| 65 | AccountsOnInit accounts, |
| 66 | VersionedAuthorizedKeysOnInit.Factory authorizedKeysFactory, |
| 67 | VersionedAuthTokensOnInit.Factory tokenFactory, |
| 68 | ExternalIdsOnInit externalIds, |
| 69 | SequencesOnInit sequencesOnInit, |
| 70 | GroupsOnInit groupsOnInit, |
| 71 | ExternalIdFactory externalIdFactory) { |
| 72 | this.flags = flags; |
| 73 | this.ui = ui; |
| 74 | this.accounts = accounts; |
| 75 | this.authorizedKeysFactory = authorizedKeysFactory; |
| 76 | this.tokenFactory = tokenFactory; |
| 77 | this.externalIds = externalIds; |
| 78 | this.sequencesOnInit = sequencesOnInit; |
| 79 | this.groupsOnInit = groupsOnInit; |
| 80 | this.externalIdFactory = externalIdFactory; |
| 81 | } |
| 82 | |
| 83 | @Override |
| 84 | public void run() {} |
| 85 | |
| 86 | @Inject |
| 87 | void set(AccountIndexCollection accountIndexCollection) { |
| 88 | this.accountIndexCollection = accountIndexCollection; |
| 89 | } |
| 90 | |
| 91 | @Inject |
| 92 | void set(GroupIndexCollection groupIndexCollection) { |
| 93 | this.groupIndexCollection = groupIndexCollection; |
| 94 | } |
| 95 | |
| 96 | @Override |
| 97 | public void postRun() throws Exception { |
| 98 | if (!accounts.hasAnyAccount()) { |
| 99 | welcome(); |
| 100 | } |
| 101 | AuthType authType = flags.cfg.getEnum(AuthType.values(), "auth", null, "type"); |
| 102 | if (authType != AuthType.DEVELOPMENT_BECOME_ANY_ACCOUNT) { |
| 103 | return; |
| 104 | } |
| 105 |
nothing calls this directly
no outgoing calls
no test coverage detected