diff --git a/internal/services/nss/testdata/default.db.yaml b/internal/services/nss/testdata/default.db.yaml index 39370c362..555563a71 100644 --- a/internal/services/nss/testdata/default.db.yaml +++ b/internal/services/nss/testdata/default.db.yaml @@ -1,31 +1,51 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"group1"}' - "22222": '{"Name":"group2","GID":22222,"UGID":"group2"}' - "33333": '{"Name":"group3","GID":33333,"UGID":"group3"}' - "99999": '{"Name":"commongroup","GID":99999,"UGID":"commongroup"}' -GroupByName: - commongroup: '{"Name":"commongroup","GID":99999,"UGID":"commongroup"}' - group1: '{"Name":"group1","GID":11111,"UGID":"group1"}' - group2: '{"Name":"group2","GID":22222,"UGID":"group2"}' - group3: '{"Name":"group3","GID":33333,"UGID":"group3"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' - "22222": '{"GID":22222,"UIDs":[2222]}' - "33333": '{"GID":33333,"UIDs":[3333]}' - "99999": '{"GID":99999,"UIDs":[2222,3333]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' - "2222": '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - "3333": '{"Name":"user3","UID":3333,"GID":33333,"Gecos":"User3","Dir":"/home/user3","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' - user2: '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - user3: '{"Name":"user3","UID":3333,"GID":33333,"Gecos":"User3","Dir":"/home/user3","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11111]}' - "2222": '{"UID":2222,"GIDs":[22222,99999]}' - "3333": '{"UID":3333,"GIDs":[33333,99999]}' -UserToBroker: - "1111": '"broker-id"' - "2222": '"broker-id"' - "3333": '"broker-id"' +users: + - name: user1 + uid: 1111 + gid: 11111 + gecos: |- + User1 gecos + On multiple lines + home: /home/user1 + shell: /bin/bash + broker_id: broker-id + last_login: 2001-01-01T01:01:01Z + - name: user2 + uid: 2222 + gid: 22222 + gecos: User2 + home: /home/user2 + shell: /bin/dash + broker_id: broker-id + last_login: 2002-02-02T02:02:02Z + - name: user3 + uid: 3333 + gid: 33333 + gecos: User3 + home: /home/user3 + shell: /bin/zsh + broker_id: broker-id + last_login: 2003-03-03T03:03:03Z +groups: + - name: group1 + gid: 11111 + ugid: group1 + - name: group2 + gid: 22222 + ugid: group2 + - name: group3 + gid: 33333 + ugid: group3 + - name: commongroup + gid: 99999 + ugid: commongroup +users_to_groups: + - uid: 1111 + gid: 11111 + - uid: 2222 + gid: 22222 + - uid: 2222 + gid: 99999 + - uid: 3333 + gid: 33333 + - uid: 3333 + gid: 99999 diff --git a/internal/services/nss/testdata/empty.db.yaml b/internal/services/nss/testdata/empty.db.yaml index f36d9bddd..b4e430668 100644 --- a/internal/services/nss/testdata/empty.db.yaml +++ b/internal/services/nss/testdata/empty.db.yaml @@ -1,7 +1,3 @@ -GroupByID: -GroupByName: -GroupToUsers: -UserByID: -UserByName: -UserToGroups: -UserToBroker: +users: [] +groups: [] +users_to_groups: [] diff --git a/internal/services/pam/testdata/TestGetPreviousBroker/get-previous-broker.db b/internal/services/pam/testdata/TestGetPreviousBroker/get-previous-broker.db index 54e5a38ef..16755a9f9 100644 --- a/internal/services/pam/testdata/TestGetPreviousBroker/get-previous-broker.db +++ b/internal/services/pam/testdata/TestGetPreviousBroker/get-previous-broker.db @@ -1,30 +1,50 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"group1"}' - "22222": '{"Name":"group2","GID":22222,"UGID":"group2"}' - "33333": '{"Name":"group3","GID":33333,"UGID":"group3"}' - "99999": '{"Name":"commongroup","GID":99999,"UGID":"commongroup"}' -GroupByName: - commongroup: '{"Name":"commongroup","GID":99999,"UGID":"commongroup"}' - group1: '{"Name":"group1","GID":11111,"UGID":"group1"}' - group2: '{"Name":"group2","GID":22222,"UGID":"group2"}' - group3: '{"Name":"group3","GID":33333,"UGID":"group3"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' - "22222": '{"GID":22222,"UIDs":[2222]}' - "33333": '{"GID":33333,"UIDs":[3333]}' - "99999": '{"GID":99999,"UIDs":[2222,3333]}' -UserByID: - "1111": '{"Name":"userwithbroker","UID":1111,"GID":11111,"Gecos":"userwithbroker gecos\nOn multiple lines","Dir":"/home/userwithbroker","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' - "2222": '{"Name":"userwithinactivebroker","UID":2222,"GID":22222,"Gecos":"userwithinactivebroker","Dir":"/home/userwithinactivebroker","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - "3333": '{"Name":"userwithoutbroker","UID":3333,"GID":33333,"Gecos":"userwithoutbroker","Dir":"/home/userwithoutbroker","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' -UserByName: - userwithbroker: '{"Name":"userwithbroker","UID":1111,"GID":11111,"Gecos":"userwithbroker gecos\nOn multiple lines","Dir":"/home/userwithbroker","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' - userwithinactivebroker: '{"Name":"userwithinactivebroker","UID":2222,"GID":22222,"Gecos":"userwithinactivebroker","Dir":"/home/userwithinactivebroker","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - userwithoutbroker: '{"Name":"userwithoutbroker","UID":3333,"GID":33333,"Gecos":"userwithoutbroker","Dir":"/home/userwithoutbroker","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11111]}' - "2222": '{"UID":2222,"GIDs":[22222,99999]}' - "3333": '{"UID":3333,"GIDs":[33333,99999]}' -UserToBroker: - "1111": '"MOCKBROKERID"' - "2222": '"inactive-broker-id"' +users: + - name: userwithbroker + uid: 1111 + gid: 11111 + gecos: |- + userwithbroker gecos + On multiple lines + home: /home/userwithbroker + shell: /bin/bash + broker_id: MOCKBROKERID + last_login: 2001-01-01T01:01:01Z + - name: userwithinactivebroker + uid: 2222 + gid: 22222 + gecos: userwithinactivebroker + home: /home/userwithinactivebroker + shell: /bin/dash + broker_id: inactive-broker-id + last_login: 2002-02-02T02:02:02Z + - name: userwithoutbroker + uid: 3333 + gid: 33333 + gecos: userwithoutbroker + home: /home/userwithoutbroker + shell: /bin/zsh + last_login: 2003-03-03T03:03:03Z +groups: + - name: group1 + gid: 11111 + ugid: group1 + - name: group2 + gid: 22222 + ugid: group2 + - name: group3 + gid: 33333 + ugid: group3 + - name: commongroup + gid: 99999 + ugid: commongroup +users_to_groups: + - uid: 1111 + gid: 11111 + - uid: 2222 + gid: 22222 + - uid: 2222 + gid: 99999 + - uid: 3333 + gid: 33333 + - uid: 3333 + gid: 99999 diff --git a/internal/services/pam/testdata/TestIsAuthenticated/cache-with-user.db b/internal/services/pam/testdata/TestIsAuthenticated/cache-with-user.db index 0a1daa637..d3fb65eca 100644 --- a/internal/services/pam/testdata/TestIsAuthenticated/cache-with-user.db +++ b/internal/services/pam/testdata/TestIsAuthenticated/cache-with-user.db @@ -1,16 +1,16 @@ -GroupByID: - "88888": '{"Name":"group-success","GID":88888,"UGID":"ugid-success"}' -GroupByName: - group-success: '{"Name":"group-success","GID":88888,"UGID":"ugid-success"}' -GroupByUGID: - ugid-success: '{"Name":"group-success","GID":88888,"UGID":"ugid-success"}' -GroupToUsers: - "88888": '{"GID":88888,"UIDs":[77777]}' -UserByID: - "77777": '{"Name":"otheruser","UID":77777,"GID":88888,"Gecos":"gecos for other user","Dir":"/home/otheruser","Shell":"/bin/sh/otheruser","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' -UserByName: - otheruser: '{"Name":"otheruser","UID":77777,"GID":88888,"Gecos":"gecos for other user","Dir":"/home/otheruser","Shell":"/bin/sh/otheruser","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' -UserToGroups: - "77777": '{"UID":77777,"GIDs":[88888]}' -UserToBroker: - "77777": '"broker-id"' +users: + - name: otheruser + uid: 77777 + gid: 88888 + gecos: gecos for other user + home: /home/otheruser + shell: /bin/sh/otheruser + broker_id: broker-id + last_login: 2001-01-01T01:01:01Z +groups: + - name: group-success + gid: 88888 + ugid: ugid-success +users_to_groups: + - uid: 77777 + gid: 88888 diff --git a/internal/services/pam/testdata/TestSetDefaultBrokerForUser/set-default-broker.db b/internal/services/pam/testdata/TestSetDefaultBrokerForUser/set-default-broker.db index 158f5b43c..524fbd753 100644 --- a/internal/services/pam/testdata/TestSetDefaultBrokerForUser/set-default-broker.db +++ b/internal/services/pam/testdata/TestSetDefaultBrokerForUser/set-default-broker.db @@ -1,43 +1,79 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"group1"}' - "22222": '{"Name":"group2","GID":22222,"UGID":"group2"}' - "33333": '{"Name":"group3","GID":33333,"UGID":"group3"}' - "44444": '{"Name":"group4","GID":44444,"UGID":"group4"}' - "55555": '{"Name":"group5","GID":55555,"UGID":"group5"}' - "99999": '{"Name":"commongroup","GID":99999,"UGID":"commongroup"}' -GroupByName: - commongroup: '{"Name":"commongroup","GID":99999,"UGID":"commongroup"}' - group1: '{"Name":"group1","GID":11111,"UGID":"group1"}' - group2: '{"Name":"group2","GID":22222,"UGID":"group2"}' - group3: '{"Name":"group3","GID":33333,"UGID":"group3"}' - group4: '{"Name":"group4","GID":44444,"UGID":"group4"}' - group5: '{"Name":"group5","GID":55555,"UGID":"group5"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' - "22222": '{"GID":22222,"UIDs":[2222]}' - "33333": '{"GID":33333,"UIDs":[3333]}' - "44444": '{"GID":44444,"UIDs":[4444]}' - "55555": '{"GID":55555,"UIDs":[5555]}' - "99999": '{"GID":99999,"UIDs":[2222,3333,4444,5555]}' -UserByID: - "1111": '{"Name":"userwithbroker","UID":1111,"GID":11111,"Gecos":"userwithbroker gecos\nOn multiple lines","Dir":"/home/userwithbroker","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' - "2222": '{"Name":"userwithinactivebroker","UID":2222,"GID":22222,"Gecos":"userwithinactivebroker","Dir":"/home/userwithinactivebroker","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - "3333": '{"Name":"userlocalbroker","UID":3333,"GID":33333,"Gecos":"userlocalbroker","Dir":"/home/userlocalbroker","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' - "4444": '{"Name":"usersetbroker","UID":4444,"GID":44444,"Gecos":"usersetbroker","Dir":"/home/usersetbroker","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2004-04-04T04:04:04Z"}' - "5555": '{"Name":"userupdatebroker","UID":5555,"GID":55555,"Gecos":"userupdatebroker","Dir":"/home/userupdatebroker","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2005-05-05T05:05:05Z"}' -UserByName: - userwithbroker: '{"Name":"userwithbroker","UID":1111,"GID":11111,"Gecos":"userwithbroker gecos\nOn multiple lines","Dir":"/home/userwithbroker","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' - userwithinactivebroker: '{"Name":"userwithinactivebroker","UID":2222,"GID":22222,"Gecos":"userwithinactivebroker","Dir":"/home/userwithinactivebroker","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - userlocalbroker: '{"Name":"userlocalbroker","UID":3333,"GID":33333,"Gecos":"userlocalbroker","Dir":"/home/userlocalbroker","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' - usersetbroker: '{"Name":"usersetbroker","UID":4444,"GID":44444,"Gecos":"usersetbroker","Dir":"/home/usersetbroker","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2004-04-04T04:04:04Z"}' - userupdatebroker: '{"Name":"userupdatebroker","UID":5555,"GID":55555,"Gecos":"userupdatebroker","Dir":"/home/userupdatebroker","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2005-05-05T05:05:05Z"}' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11111]}' - "2222": '{"UID":2222,"GIDs":[22222,99999]}' - "3333": '{"UID":3333,"GIDs":[33333,99999]}' - "4444": '{"UID":4444,"GIDs":[44444,99999]}' - "5555": '{"UID":5555,"GIDs":[55555,99999]}' -UserToBroker: - "1111": '"broker-id"' - "2222": '"inactive-broker-id"' - "5555": '"tobereplaced-broker-id"' +users: + - name: userwithbroker + uid: 1111 + gid: 11111 + gecos: |- + userwithbroker gecos + On multiple lines + home: /home/userwithbroker + shell: /bin/bash + broker_id: broker-id + last_login: 2001-01-01T01:01:01Z + - name: userwithinactivebroker + uid: 2222 + gid: 22222 + gecos: userwithinactivebroker + home: /home/userwithinactivebroker + shell: /bin/dash + broker_id: inactive-broker-id + last_login: 2002-02-02T02:02:02Z + - name: userlocalbroker + uid: 3333 + gid: 33333 + gecos: userlocalbroker + home: /home/userlocalbroker + shell: /bin/zsh + last_login: 2003-03-03T03:03:03Z + - name: usersetbroker + uid: 4444 + gid: 44444 + gecos: usersetbroker + home: /home/usersetbroker + shell: /bin/dash + last_login: 2004-04-04T04:04:04Z + - name: userupdatebroker + uid: 5555 + gid: 55555 + gecos: userupdatebroker + home: /home/userupdatebroker + shell: /bin/zsh + broker_id: tobereplaced-broker-id + last_login: 2005-05-05T05:05:05Z +groups: + - name: group1 + gid: 11111 + ugid: group1 + - name: group2 + gid: 22222 + ugid: group2 + - name: group3 + gid: 33333 + ugid: group3 + - name: group4 + gid: 44444 + ugid: group4 + - name: group5 + gid: 55555 + ugid: group5 + - name: commongroup + gid: 99999 + ugid: commongroup +users_to_groups: + - uid: 1111 + gid: 11111 + - uid: 2222 + gid: 22222 + - uid: 2222 + gid: 99999 + - uid: 3333 + gid: 33333 + - uid: 3333 + gid: 99999 + - uid: 4444 + gid: 44444 + - uid: 4444 + gid: 99999 + - uid: 5555 + gid: 55555 + - uid: 5555 + gid: 99999 diff --git a/internal/services/pam/testdata/golden/TestIDGeneration/Generate_ID/cache.db b/internal/services/pam/testdata/golden/TestIDGeneration/Generate_ID/cache.db index 013e1066f..39f615b28 100644 --- a/internal/services/pam/testdata/golden/TestIDGeneration/Generate_ID/cache.db +++ b/internal/services/pam/testdata/golden/TestIDGeneration/Generate_ID/cache.db @@ -1,21 +1,20 @@ -GroupByID: - "1111": '{"Name":"TestIDGeneration_separator_success","GID":1111,"UGID":"TestIDGeneration_separator_success"}' - "2222": '{"Name":"group-success","GID":2222,"UGID":"ugid-success"}' -GroupByName: - TestIDGeneration_separator_success: '{"Name":"TestIDGeneration_separator_success","GID":1111,"UGID":"TestIDGeneration_separator_success"}' - group-success: '{"Name":"group-success","GID":2222,"UGID":"ugid-success"}' -GroupByUGID: - TestIDGeneration_separator_success: '{"Name":"TestIDGeneration_separator_success","GID":1111,"UGID":"TestIDGeneration_separator_success"}' - ugid-success: '{"Name":"group-success","GID":2222,"UGID":"ugid-success"}' -GroupToUsers: - "1111": '{"GID":1111,"UIDs":[1111]}' - "2222": '{"GID":2222,"UIDs":[1111]}' -UserByID: - "1111": '{"Name":"TestIDGeneration_separator_success","UID":1111,"GID":1111,"Gecos":"gecos for success","Dir":"/home/success","Shell":"/bin/sh/success","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserByName: - TestIDGeneration_separator_success: '{"Name":"TestIDGeneration_separator_success","UID":1111,"GID":1111,"Gecos":"gecos for success","Dir":"/home/success","Shell":"/bin/sh/success","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserToBroker: {} -UserToGroups: - "1111": '{"UID":1111,"GIDs":[1111,2222]}' -UserToLocalGroups: - "1111": "null" +users: + - name: TestIDGeneration_separator_success + uid: 1111 + gid: 1111 + gecos: gecos for success + home: /home/success + shell: /bin/sh/success + last_login: 2020-01-01T00:00:00Z +groups: + - name: TestIDGeneration_separator_success + gid: 1111 + ugid: TestIDGeneration_separator_success + - name: group-success + gid: 2222 + ugid: ugid-success +users_to_groups: + - uid: 1111 + gid: 1111 + - uid: 1111 + gid: 2222 diff --git a/internal/services/pam/testdata/golden/TestIsAuthenticated/Denies_authentication_when_broker_times_out/cache.db b/internal/services/pam/testdata/golden/TestIsAuthenticated/Denies_authentication_when_broker_times_out/cache.db index 79f78e127..b4e430668 100644 --- a/internal/services/pam/testdata/golden/TestIsAuthenticated/Denies_authentication_when_broker_times_out/cache.db +++ b/internal/services/pam/testdata/golden/TestIsAuthenticated/Denies_authentication_when_broker_times_out/cache.db @@ -1,9 +1,3 @@ -GroupByID: {} -GroupByName: {} -GroupByUGID: {} -GroupToUsers: {} -UserByID: {} -UserByName: {} -UserToBroker: {} -UserToGroups: {} -UserToLocalGroups: {} +users: [] +groups: [] +users_to_groups: [] diff --git a/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_on_empty_data_even_if_granted/cache.db b/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_on_empty_data_even_if_granted/cache.db index 79f78e127..b4e430668 100644 --- a/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_on_empty_data_even_if_granted/cache.db +++ b/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_on_empty_data_even_if_granted/cache.db @@ -1,9 +1,3 @@ -GroupByID: {} -GroupByName: {} -GroupByUGID: {} -GroupToUsers: {} -UserByID: {} -UserByName: {} -UserToBroker: {} -UserToGroups: {} -UserToLocalGroups: {} +users: [] +groups: [] +users_to_groups: [] diff --git a/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file/cache.db b/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file/cache.db index 4fe7e1141..8f45f8a0c 100644 --- a/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file/cache.db +++ b/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file/cache.db @@ -1,21 +1,20 @@ -GroupByID: - "1111": '{"Name":"TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file_separator_success_with_local_groups","GID":1111,"UGID":"TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file_separator_success_with_local_groups"}' - "2222": '{"Name":"group-success_with_local_groups","GID":2222,"UGID":"ugid-success_with_local_groups"}' -GroupByName: - TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file_separator_success_with_local_groups: '{"Name":"TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file_separator_success_with_local_groups","GID":1111,"UGID":"TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file_separator_success_with_local_groups"}' - group-success_with_local_groups: '{"Name":"group-success_with_local_groups","GID":2222,"UGID":"ugid-success_with_local_groups"}' -GroupByUGID: - TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file_separator_success_with_local_groups: '{"Name":"TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file_separator_success_with_local_groups","GID":1111,"UGID":"TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file_separator_success_with_local_groups"}' - ugid-success_with_local_groups: '{"Name":"group-success_with_local_groups","GID":2222,"UGID":"ugid-success_with_local_groups"}' -GroupToUsers: - "1111": '{"GID":1111,"UIDs":[1111]}' - "2222": '{"GID":2222,"UIDs":[1111]}' -UserByID: - "1111": '{"Name":"TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file_separator_success_with_local_groups","UID":1111,"GID":1111,"Gecos":"gecos for success_with_local_groups","Dir":"/home/success_with_local_groups","Shell":"/bin/sh/success_with_local_groups","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserByName: - TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file_separator_success_with_local_groups: '{"Name":"TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file_separator_success_with_local_groups","UID":1111,"GID":1111,"Gecos":"gecos for success_with_local_groups","Dir":"/home/success_with_local_groups","Shell":"/bin/sh/success_with_local_groups","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserToBroker: {} -UserToGroups: - "1111": '{"UID":1111,"GIDs":[1111,2222]}' -UserToLocalGroups: - "1111": '["localgroup1","localgroup3"]' +users: + - name: TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file_separator_success_with_local_groups + uid: 1111 + gid: 1111 + gecos: gecos for success_with_local_groups + home: /home/success_with_local_groups + shell: /bin/sh/success_with_local_groups + last_login: 2020-01-01T00:00:00Z +groups: + - name: TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file_separator_success_with_local_groups + gid: 1111 + ugid: TestIsAuthenticated/Error_on_updating_local_groups_with_unexisting_file_separator_success_with_local_groups + - name: group-success_with_local_groups + gid: 2222 + ugid: ugid-success_with_local_groups +users_to_groups: + - uid: 1111 + gid: 1111 + - uid: 1111 + gid: 2222 diff --git a/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_authenticating/cache.db b/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_authenticating/cache.db index 79f78e127..b4e430668 100644 --- a/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_authenticating/cache.db +++ b/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_authenticating/cache.db @@ -1,9 +1,3 @@ -GroupByID: {} -GroupByName: {} -GroupByUGID: {} -GroupToUsers: {} -UserByID: {} -UserByName: {} -UserToBroker: {} -UserToGroups: {} -UserToLocalGroups: {} +users: [] +groups: [] +users_to_groups: [] diff --git a/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_broker_returns_invalid_access/cache.db b/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_broker_returns_invalid_access/cache.db index 79f78e127..b4e430668 100644 --- a/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_broker_returns_invalid_access/cache.db +++ b/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_broker_returns_invalid_access/cache.db @@ -1,9 +1,3 @@ -GroupByID: {} -GroupByName: {} -GroupByUGID: {} -GroupToUsers: {} -UserByID: {} -UserByName: {} -UserToBroker: {} -UserToGroups: {} -UserToLocalGroups: {} +users: [] +groups: [] +users_to_groups: [] diff --git a/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_broker_returns_invalid_data/cache.db b/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_broker_returns_invalid_data/cache.db index 79f78e127..b4e430668 100644 --- a/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_broker_returns_invalid_data/cache.db +++ b/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_broker_returns_invalid_data/cache.db @@ -1,9 +1,3 @@ -GroupByID: {} -GroupByName: {} -GroupByUGID: {} -GroupToUsers: {} -UserByID: {} -UserByName: {} -UserToBroker: {} -UserToGroups: {} -UserToLocalGroups: {} +users: [] +groups: [] +users_to_groups: [] diff --git a/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_broker_returns_invalid_userinfo/cache.db b/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_broker_returns_invalid_userinfo/cache.db index 79f78e127..b4e430668 100644 --- a/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_broker_returns_invalid_userinfo/cache.db +++ b/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_broker_returns_invalid_userinfo/cache.db @@ -1,9 +1,3 @@ -GroupByID: {} -GroupByName: {} -GroupByUGID: {} -GroupToUsers: {} -UserByID: {} -UserByName: {} -UserToBroker: {} -UserToGroups: {} -UserToLocalGroups: {} +users: [] +groups: [] +users_to_groups: [] diff --git a/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_calling_second_time_without_cancelling/cache.db b/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_calling_second_time_without_cancelling/cache.db index 680f8f21c..85446f81b 100644 --- a/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_calling_second_time_without_cancelling/cache.db +++ b/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_calling_second_time_without_cancelling/cache.db @@ -1,21 +1,20 @@ -GroupByID: - "1111": '{"Name":"TestIsAuthenticated/Error_when_calling_second_time_without_cancelling_separator_IA_second_call","GID":1111,"UGID":"TestIsAuthenticated/Error_when_calling_second_time_without_cancelling_separator_IA_second_call"}' - "2222": '{"Name":"group-IA_second_call","GID":2222,"UGID":"ugid-IA_second_call"}' -GroupByName: - TestIsAuthenticated/Error_when_calling_second_time_without_cancelling_separator_IA_second_call: '{"Name":"TestIsAuthenticated/Error_when_calling_second_time_without_cancelling_separator_IA_second_call","GID":1111,"UGID":"TestIsAuthenticated/Error_when_calling_second_time_without_cancelling_separator_IA_second_call"}' - group-IA_second_call: '{"Name":"group-IA_second_call","GID":2222,"UGID":"ugid-IA_second_call"}' -GroupByUGID: - TestIsAuthenticated/Error_when_calling_second_time_without_cancelling_separator_IA_second_call: '{"Name":"TestIsAuthenticated/Error_when_calling_second_time_without_cancelling_separator_IA_second_call","GID":1111,"UGID":"TestIsAuthenticated/Error_when_calling_second_time_without_cancelling_separator_IA_second_call"}' - ugid-IA_second_call: '{"Name":"group-IA_second_call","GID":2222,"UGID":"ugid-IA_second_call"}' -GroupToUsers: - "1111": '{"GID":1111,"UIDs":[1111]}' - "2222": '{"GID":2222,"UIDs":[1111]}' -UserByID: - "1111": '{"Name":"TestIsAuthenticated/Error_when_calling_second_time_without_cancelling_separator_IA_second_call","UID":1111,"GID":1111,"Gecos":"gecos for IA_second_call","Dir":"/home/IA_second_call","Shell":"/bin/sh/IA_second_call","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserByName: - TestIsAuthenticated/Error_when_calling_second_time_without_cancelling_separator_IA_second_call: '{"Name":"TestIsAuthenticated/Error_when_calling_second_time_without_cancelling_separator_IA_second_call","UID":1111,"GID":1111,"Gecos":"gecos for IA_second_call","Dir":"/home/IA_second_call","Shell":"/bin/sh/IA_second_call","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserToBroker: {} -UserToGroups: - "1111": '{"UID":1111,"GIDs":[1111,2222]}' -UserToLocalGroups: - "1111": "null" +users: + - name: TestIsAuthenticated/Error_when_calling_second_time_without_cancelling_separator_IA_second_call + uid: 1111 + gid: 1111 + gecos: gecos for IA_second_call + home: /home/IA_second_call + shell: /bin/sh/IA_second_call + last_login: 2020-01-01T00:00:00Z +groups: + - name: TestIsAuthenticated/Error_when_calling_second_time_without_cancelling_separator_IA_second_call + gid: 1111 + ugid: TestIsAuthenticated/Error_when_calling_second_time_without_cancelling_separator_IA_second_call + - name: group-IA_second_call + gid: 2222 + ugid: ugid-IA_second_call +users_to_groups: + - uid: 1111 + gid: 1111 + - uid: 1111 + gid: 2222 diff --git a/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_not_root/cache.db b/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_not_root/cache.db index 79f78e127..b4e430668 100644 --- a/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_not_root/cache.db +++ b/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_not_root/cache.db @@ -1,9 +1,3 @@ -GroupByID: {} -GroupByName: {} -GroupByUGID: {} -GroupToUsers: {} -UserByID: {} -UserByName: {} -UserToBroker: {} -UserToGroups: {} -UserToLocalGroups: {} +users: [] +groups: [] +users_to_groups: [] diff --git a/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_sessionID_is_empty/cache.db b/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_sessionID_is_empty/cache.db index 79f78e127..b4e430668 100644 --- a/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_sessionID_is_empty/cache.db +++ b/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_sessionID_is_empty/cache.db @@ -1,9 +1,3 @@ -GroupByID: {} -GroupByName: {} -GroupByUGID: {} -GroupToUsers: {} -UserByID: {} -UserByName: {} -UserToBroker: {} -UserToGroups: {} -UserToLocalGroups: {} +users: [] +groups: [] +users_to_groups: [] diff --git a/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_there_is_no_broker/cache.db b/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_there_is_no_broker/cache.db index 79f78e127..b4e430668 100644 --- a/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_there_is_no_broker/cache.db +++ b/internal/services/pam/testdata/golden/TestIsAuthenticated/Error_when_there_is_no_broker/cache.db @@ -1,9 +1,3 @@ -GroupByID: {} -GroupByName: {} -GroupByUGID: {} -GroupToUsers: {} -UserByID: {} -UserByName: {} -UserToBroker: {} -UserToGroups: {} -UserToLocalGroups: {} +users: [] +groups: [] +users_to_groups: [] diff --git a/internal/services/pam/testdata/golden/TestIsAuthenticated/Successfully_authenticate/cache.db b/internal/services/pam/testdata/golden/TestIsAuthenticated/Successfully_authenticate/cache.db index a38a5fc84..b012b3a62 100644 --- a/internal/services/pam/testdata/golden/TestIsAuthenticated/Successfully_authenticate/cache.db +++ b/internal/services/pam/testdata/golden/TestIsAuthenticated/Successfully_authenticate/cache.db @@ -1,21 +1,20 @@ -GroupByID: - "1111": '{"Name":"TestIsAuthenticated/Successfully_authenticate_separator_success","GID":1111,"UGID":"TestIsAuthenticated/Successfully_authenticate_separator_success"}' - "2222": '{"Name":"group-success","GID":2222,"UGID":"ugid-success"}' -GroupByName: - TestIsAuthenticated/Successfully_authenticate_separator_success: '{"Name":"TestIsAuthenticated/Successfully_authenticate_separator_success","GID":1111,"UGID":"TestIsAuthenticated/Successfully_authenticate_separator_success"}' - group-success: '{"Name":"group-success","GID":2222,"UGID":"ugid-success"}' -GroupByUGID: - TestIsAuthenticated/Successfully_authenticate_separator_success: '{"Name":"TestIsAuthenticated/Successfully_authenticate_separator_success","GID":1111,"UGID":"TestIsAuthenticated/Successfully_authenticate_separator_success"}' - ugid-success: '{"Name":"group-success","GID":2222,"UGID":"ugid-success"}' -GroupToUsers: - "1111": '{"GID":1111,"UIDs":[1111]}' - "2222": '{"GID":2222,"UIDs":[1111]}' -UserByID: - "1111": '{"Name":"TestIsAuthenticated/Successfully_authenticate_separator_success","UID":1111,"GID":1111,"Gecos":"gecos for success","Dir":"/home/success","Shell":"/bin/sh/success","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserByName: - TestIsAuthenticated/Successfully_authenticate_separator_success: '{"Name":"TestIsAuthenticated/Successfully_authenticate_separator_success","UID":1111,"GID":1111,"Gecos":"gecos for success","Dir":"/home/success","Shell":"/bin/sh/success","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserToBroker: {} -UserToGroups: - "1111": '{"UID":1111,"GIDs":[1111,2222]}' -UserToLocalGroups: - "1111": "null" +users: + - name: TestIsAuthenticated/Successfully_authenticate_separator_success + uid: 1111 + gid: 1111 + gecos: gecos for success + home: /home/success + shell: /bin/sh/success + last_login: 2020-01-01T00:00:00Z +groups: + - name: TestIsAuthenticated/Successfully_authenticate_separator_success + gid: 1111 + ugid: TestIsAuthenticated/Successfully_authenticate_separator_success + - name: group-success + gid: 2222 + ugid: ugid-success +users_to_groups: + - uid: 1111 + gid: 1111 + - uid: 1111 + gid: 2222 diff --git a/internal/services/pam/testdata/golden/TestIsAuthenticated/Successfully_authenticate_if_first_call_is_canceled/cache.db b/internal/services/pam/testdata/golden/TestIsAuthenticated/Successfully_authenticate_if_first_call_is_canceled/cache.db index f022ec223..836e3efea 100644 --- a/internal/services/pam/testdata/golden/TestIsAuthenticated/Successfully_authenticate_if_first_call_is_canceled/cache.db +++ b/internal/services/pam/testdata/golden/TestIsAuthenticated/Successfully_authenticate_if_first_call_is_canceled/cache.db @@ -1,21 +1,20 @@ -GroupByID: - "1111": '{"Name":"TestIsAuthenticated/Successfully_authenticate_if_first_call_is_canceled_separator_IA_second_call","GID":1111,"UGID":"TestIsAuthenticated/Successfully_authenticate_if_first_call_is_canceled_separator_IA_second_call"}' - "2222": '{"Name":"group-IA_second_call","GID":2222,"UGID":"ugid-IA_second_call"}' -GroupByName: - TestIsAuthenticated/Successfully_authenticate_if_first_call_is_canceled_separator_IA_second_call: '{"Name":"TestIsAuthenticated/Successfully_authenticate_if_first_call_is_canceled_separator_IA_second_call","GID":1111,"UGID":"TestIsAuthenticated/Successfully_authenticate_if_first_call_is_canceled_separator_IA_second_call"}' - group-IA_second_call: '{"Name":"group-IA_second_call","GID":2222,"UGID":"ugid-IA_second_call"}' -GroupByUGID: - TestIsAuthenticated/Successfully_authenticate_if_first_call_is_canceled_separator_IA_second_call: '{"Name":"TestIsAuthenticated/Successfully_authenticate_if_first_call_is_canceled_separator_IA_second_call","GID":1111,"UGID":"TestIsAuthenticated/Successfully_authenticate_if_first_call_is_canceled_separator_IA_second_call"}' - ugid-IA_second_call: '{"Name":"group-IA_second_call","GID":2222,"UGID":"ugid-IA_second_call"}' -GroupToUsers: - "1111": '{"GID":1111,"UIDs":[1111]}' - "2222": '{"GID":2222,"UIDs":[1111]}' -UserByID: - "1111": '{"Name":"TestIsAuthenticated/Successfully_authenticate_if_first_call_is_canceled_separator_IA_second_call","UID":1111,"GID":1111,"Gecos":"gecos for IA_second_call","Dir":"/home/IA_second_call","Shell":"/bin/sh/IA_second_call","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserByName: - TestIsAuthenticated/Successfully_authenticate_if_first_call_is_canceled_separator_IA_second_call: '{"Name":"TestIsAuthenticated/Successfully_authenticate_if_first_call_is_canceled_separator_IA_second_call","UID":1111,"GID":1111,"Gecos":"gecos for IA_second_call","Dir":"/home/IA_second_call","Shell":"/bin/sh/IA_second_call","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserToBroker: {} -UserToGroups: - "1111": '{"UID":1111,"GIDs":[1111,2222]}' -UserToLocalGroups: - "1111": "null" +users: + - name: TestIsAuthenticated/Successfully_authenticate_if_first_call_is_canceled_separator_IA_second_call + uid: 1111 + gid: 1111 + gecos: gecos for IA_second_call + home: /home/IA_second_call + shell: /bin/sh/IA_second_call + last_login: 2020-01-01T00:00:00Z +groups: + - name: TestIsAuthenticated/Successfully_authenticate_if_first_call_is_canceled_separator_IA_second_call + gid: 1111 + ugid: TestIsAuthenticated/Successfully_authenticate_if_first_call_is_canceled_separator_IA_second_call + - name: group-IA_second_call + gid: 2222 + ugid: ugid-IA_second_call +users_to_groups: + - uid: 1111 + gid: 1111 + - uid: 1111 + gid: 2222 diff --git a/internal/services/pam/testdata/golden/TestIsAuthenticated/Update_existing_DB_on_success/cache.db b/internal/services/pam/testdata/golden/TestIsAuthenticated/Update_existing_DB_on_success/cache.db index 5c9baa79d..69b9b3ce8 100644 --- a/internal/services/pam/testdata/golden/TestIsAuthenticated/Update_existing_DB_on_success/cache.db +++ b/internal/services/pam/testdata/golden/TestIsAuthenticated/Update_existing_DB_on_success/cache.db @@ -1,25 +1,30 @@ -GroupByID: - "1111": '{"Name":"TestIsAuthenticated/Update_existing_DB_on_success_separator_success","GID":1111,"UGID":"TestIsAuthenticated/Update_existing_DB_on_success_separator_success"}' - "88888": '{"Name":"group-success","GID":88888,"UGID":"ugid-success"}' -GroupByName: - TestIsAuthenticated/Update_existing_DB_on_success_separator_success: '{"Name":"TestIsAuthenticated/Update_existing_DB_on_success_separator_success","GID":1111,"UGID":"TestIsAuthenticated/Update_existing_DB_on_success_separator_success"}' - group-success: '{"Name":"group-success","GID":88888,"UGID":"ugid-success"}' -GroupByUGID: - TestIsAuthenticated/Update_existing_DB_on_success_separator_success: '{"Name":"TestIsAuthenticated/Update_existing_DB_on_success_separator_success","GID":1111,"UGID":"TestIsAuthenticated/Update_existing_DB_on_success_separator_success"}' - ugid-success: '{"Name":"group-success","GID":88888,"UGID":"ugid-success"}' -GroupToUsers: - "1111": '{"GID":1111,"UIDs":[1111]}' - "88888": '{"GID":88888,"UIDs":[77777,1111]}' -UserByID: - "1111": '{"Name":"TestIsAuthenticated/Update_existing_DB_on_success_separator_success","UID":1111,"GID":1111,"Gecos":"gecos for success","Dir":"/home/success","Shell":"/bin/sh/success","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' - "77777": '{"Name":"otheruser","UID":77777,"GID":88888,"Gecos":"gecos for other user","Dir":"/home/otheruser","Shell":"/bin/sh/otheruser","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' -UserByName: - TestIsAuthenticated/Update_existing_DB_on_success_separator_success: '{"Name":"TestIsAuthenticated/Update_existing_DB_on_success_separator_success","UID":1111,"GID":1111,"Gecos":"gecos for success","Dir":"/home/success","Shell":"/bin/sh/success","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' - otheruser: '{"Name":"otheruser","UID":77777,"GID":88888,"Gecos":"gecos for other user","Dir":"/home/otheruser","Shell":"/bin/sh/otheruser","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' -UserToBroker: - "77777": '"broker-id"' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[1111,88888]}' - "77777": '{"UID":77777,"GIDs":[88888]}' -UserToLocalGroups: - "1111": "null" +users: + - name: TestIsAuthenticated/Update_existing_DB_on_success_separator_success + uid: 1111 + gid: 1111 + gecos: gecos for success + home: /home/success + shell: /bin/sh/success + last_login: 2020-01-01T00:00:00Z + - name: otheruser + uid: 77777 + gid: 88888 + gecos: gecos for other user + home: /home/otheruser + shell: /bin/sh/otheruser + broker_id: broker-id + last_login: 2001-01-01T01:01:01Z +groups: + - name: TestIsAuthenticated/Update_existing_DB_on_success_separator_success + gid: 1111 + ugid: TestIsAuthenticated/Update_existing_DB_on_success_separator_success + - name: group-success + gid: 88888 + ugid: ugid-success +users_to_groups: + - uid: 1111 + gid: 1111 + - uid: 1111 + gid: 88888 + - uid: 77777 + gid: 88888 diff --git a/internal/services/pam/testdata/golden/TestIsAuthenticated/Update_local_groups/cache.db b/internal/services/pam/testdata/golden/TestIsAuthenticated/Update_local_groups/cache.db index 74e38fd19..1e7bee0ea 100644 --- a/internal/services/pam/testdata/golden/TestIsAuthenticated/Update_local_groups/cache.db +++ b/internal/services/pam/testdata/golden/TestIsAuthenticated/Update_local_groups/cache.db @@ -1,21 +1,20 @@ -GroupByID: - "1111": '{"Name":"TestIsAuthenticated/Update_local_groups_separator_success_with_local_groups","GID":1111,"UGID":"TestIsAuthenticated/Update_local_groups_separator_success_with_local_groups"}' - "2222": '{"Name":"group-success_with_local_groups","GID":2222,"UGID":"ugid-success_with_local_groups"}' -GroupByName: - TestIsAuthenticated/Update_local_groups_separator_success_with_local_groups: '{"Name":"TestIsAuthenticated/Update_local_groups_separator_success_with_local_groups","GID":1111,"UGID":"TestIsAuthenticated/Update_local_groups_separator_success_with_local_groups"}' - group-success_with_local_groups: '{"Name":"group-success_with_local_groups","GID":2222,"UGID":"ugid-success_with_local_groups"}' -GroupByUGID: - TestIsAuthenticated/Update_local_groups_separator_success_with_local_groups: '{"Name":"TestIsAuthenticated/Update_local_groups_separator_success_with_local_groups","GID":1111,"UGID":"TestIsAuthenticated/Update_local_groups_separator_success_with_local_groups"}' - ugid-success_with_local_groups: '{"Name":"group-success_with_local_groups","GID":2222,"UGID":"ugid-success_with_local_groups"}' -GroupToUsers: - "1111": '{"GID":1111,"UIDs":[1111]}' - "2222": '{"GID":2222,"UIDs":[1111]}' -UserByID: - "1111": '{"Name":"TestIsAuthenticated/Update_local_groups_separator_success_with_local_groups","UID":1111,"GID":1111,"Gecos":"gecos for success_with_local_groups","Dir":"/home/success_with_local_groups","Shell":"/bin/sh/success_with_local_groups","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserByName: - TestIsAuthenticated/Update_local_groups_separator_success_with_local_groups: '{"Name":"TestIsAuthenticated/Update_local_groups_separator_success_with_local_groups","UID":1111,"GID":1111,"Gecos":"gecos for success_with_local_groups","Dir":"/home/success_with_local_groups","Shell":"/bin/sh/success_with_local_groups","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserToBroker: {} -UserToGroups: - "1111": '{"UID":1111,"GIDs":[1111,2222]}' -UserToLocalGroups: - "1111": '["localgroup1","localgroup3"]' +users: + - name: TestIsAuthenticated/Update_local_groups_separator_success_with_local_groups + uid: 1111 + gid: 1111 + gecos: gecos for success_with_local_groups + home: /home/success_with_local_groups + shell: /bin/sh/success_with_local_groups + last_login: 2020-01-01T00:00:00Z +groups: + - name: TestIsAuthenticated/Update_local_groups_separator_success_with_local_groups + gid: 1111 + ugid: TestIsAuthenticated/Update_local_groups_separator_success_with_local_groups + - name: group-success_with_local_groups + gid: 2222 + ugid: ugid-success_with_local_groups +users_to_groups: + - uid: 1111 + gid: 1111 + - uid: 1111 + gid: 2222 diff --git a/internal/services/pam/testdata/golden/TestSetDefaultBrokerForUser/Set_default_broker_for_existing_user_with_no_broker/cache.db b/internal/services/pam/testdata/golden/TestSetDefaultBrokerForUser/Set_default_broker_for_existing_user_with_no_broker/cache.db index 3c8b11e92..e4414ff03 100644 --- a/internal/services/pam/testdata/golden/TestSetDefaultBrokerForUser/Set_default_broker_for_existing_user_with_no_broker/cache.db +++ b/internal/services/pam/testdata/golden/TestSetDefaultBrokerForUser/Set_default_broker_for_existing_user_with_no_broker/cache.db @@ -1,46 +1,80 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"group1"}' - "22222": '{"Name":"group2","GID":22222,"UGID":"group2"}' - "33333": '{"Name":"group3","GID":33333,"UGID":"group3"}' - "44444": '{"Name":"group4","GID":44444,"UGID":"group4"}' - "55555": '{"Name":"group5","GID":55555,"UGID":"group5"}' - "99999": '{"Name":"commongroup","GID":99999,"UGID":"commongroup"}' -GroupByName: - commongroup: '{"Name":"commongroup","GID":99999,"UGID":"commongroup"}' - group1: '{"Name":"group1","GID":11111,"UGID":"group1"}' - group2: '{"Name":"group2","GID":22222,"UGID":"group2"}' - group3: '{"Name":"group3","GID":33333,"UGID":"group3"}' - group4: '{"Name":"group4","GID":44444,"UGID":"group4"}' - group5: '{"Name":"group5","GID":55555,"UGID":"group5"}' -GroupByUGID: {} -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' - "22222": '{"GID":22222,"UIDs":[2222]}' - "33333": '{"GID":33333,"UIDs":[3333]}' - "44444": '{"GID":44444,"UIDs":[4444]}' - "55555": '{"GID":55555,"UIDs":[5555]}' - "99999": '{"GID":99999,"UIDs":[2222,3333,4444,5555]}' -UserByID: - "1111": '{"Name":"userwithbroker","UID":1111,"GID":11111,"Gecos":"userwithbroker gecos\nOn multiple lines","Dir":"/home/userwithbroker","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' - "2222": '{"Name":"userwithinactivebroker","UID":2222,"GID":22222,"Gecos":"userwithinactivebroker","Dir":"/home/userwithinactivebroker","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - "3333": '{"Name":"userlocalbroker","UID":3333,"GID":33333,"Gecos":"userlocalbroker","Dir":"/home/userlocalbroker","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' - "4444": '{"Name":"usersetbroker","UID":4444,"GID":44444,"Gecos":"usersetbroker","Dir":"/home/usersetbroker","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2004-04-04T04:04:04Z"}' - "5555": '{"Name":"userupdatebroker","UID":5555,"GID":55555,"Gecos":"userupdatebroker","Dir":"/home/userupdatebroker","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2005-05-05T05:05:05Z"}' -UserByName: - userlocalbroker: '{"Name":"userlocalbroker","UID":3333,"GID":33333,"Gecos":"userlocalbroker","Dir":"/home/userlocalbroker","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' - usersetbroker: '{"Name":"usersetbroker","UID":4444,"GID":44444,"Gecos":"usersetbroker","Dir":"/home/usersetbroker","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2004-04-04T04:04:04Z"}' - userupdatebroker: '{"Name":"userupdatebroker","UID":5555,"GID":55555,"Gecos":"userupdatebroker","Dir":"/home/userupdatebroker","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2005-05-05T05:05:05Z"}' - userwithbroker: '{"Name":"userwithbroker","UID":1111,"GID":11111,"Gecos":"userwithbroker gecos\nOn multiple lines","Dir":"/home/userwithbroker","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' - userwithinactivebroker: '{"Name":"userwithinactivebroker","UID":2222,"GID":22222,"Gecos":"userwithinactivebroker","Dir":"/home/userwithinactivebroker","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' -UserToBroker: - "1111": '"broker-id"' - "2222": '"inactive-broker-id"' - "4444": '"1902181170"' - "5555": '"tobereplaced-broker-id"' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11111]}' - "2222": '{"UID":2222,"GIDs":[22222,99999]}' - "3333": '{"UID":3333,"GIDs":[33333,99999]}' - "4444": '{"UID":4444,"GIDs":[44444,99999]}' - "5555": '{"UID":5555,"GIDs":[55555,99999]}' -UserToLocalGroups: {} +users: + - name: userwithbroker + uid: 1111 + gid: 11111 + gecos: |- + userwithbroker gecos + On multiple lines + home: /home/userwithbroker + shell: /bin/bash + broker_id: broker-id + last_login: 2001-01-01T01:01:01Z + - name: userwithinactivebroker + uid: 2222 + gid: 22222 + gecos: userwithinactivebroker + home: /home/userwithinactivebroker + shell: /bin/dash + broker_id: inactive-broker-id + last_login: 2002-02-02T02:02:02Z + - name: userlocalbroker + uid: 3333 + gid: 33333 + gecos: userlocalbroker + home: /home/userlocalbroker + shell: /bin/zsh + last_login: 2003-03-03T03:03:03Z + - name: usersetbroker + uid: 4444 + gid: 44444 + gecos: usersetbroker + home: /home/usersetbroker + shell: /bin/dash + broker_id: "1902181170" + last_login: 2004-04-04T04:04:04Z + - name: userupdatebroker + uid: 5555 + gid: 55555 + gecos: userupdatebroker + home: /home/userupdatebroker + shell: /bin/zsh + broker_id: tobereplaced-broker-id + last_login: 2005-05-05T05:05:05Z +groups: + - name: group1 + gid: 11111 + ugid: group1 + - name: group2 + gid: 22222 + ugid: group2 + - name: group3 + gid: 33333 + ugid: group3 + - name: group4 + gid: 44444 + ugid: group4 + - name: group5 + gid: 55555 + ugid: group5 + - name: commongroup + gid: 99999 + ugid: commongroup +users_to_groups: + - uid: 1111 + gid: 11111 + - uid: 2222 + gid: 22222 + - uid: 2222 + gid: 99999 + - uid: 3333 + gid: 33333 + - uid: 3333 + gid: 99999 + - uid: 4444 + gid: 44444 + - uid: 4444 + gid: 99999 + - uid: 5555 + gid: 55555 + - uid: 5555 + gid: 99999 diff --git a/internal/services/pam/testdata/golden/TestSetDefaultBrokerForUser/Update_default_broker_for_existing_user_with_a_broker/cache.db b/internal/services/pam/testdata/golden/TestSetDefaultBrokerForUser/Update_default_broker_for_existing_user_with_a_broker/cache.db index bd68f2aa7..39f1590c6 100644 --- a/internal/services/pam/testdata/golden/TestSetDefaultBrokerForUser/Update_default_broker_for_existing_user_with_a_broker/cache.db +++ b/internal/services/pam/testdata/golden/TestSetDefaultBrokerForUser/Update_default_broker_for_existing_user_with_a_broker/cache.db @@ -1,45 +1,79 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"group1"}' - "22222": '{"Name":"group2","GID":22222,"UGID":"group2"}' - "33333": '{"Name":"group3","GID":33333,"UGID":"group3"}' - "44444": '{"Name":"group4","GID":44444,"UGID":"group4"}' - "55555": '{"Name":"group5","GID":55555,"UGID":"group5"}' - "99999": '{"Name":"commongroup","GID":99999,"UGID":"commongroup"}' -GroupByName: - commongroup: '{"Name":"commongroup","GID":99999,"UGID":"commongroup"}' - group1: '{"Name":"group1","GID":11111,"UGID":"group1"}' - group2: '{"Name":"group2","GID":22222,"UGID":"group2"}' - group3: '{"Name":"group3","GID":33333,"UGID":"group3"}' - group4: '{"Name":"group4","GID":44444,"UGID":"group4"}' - group5: '{"Name":"group5","GID":55555,"UGID":"group5"}' -GroupByUGID: {} -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' - "22222": '{"GID":22222,"UIDs":[2222]}' - "33333": '{"GID":33333,"UIDs":[3333]}' - "44444": '{"GID":44444,"UIDs":[4444]}' - "55555": '{"GID":55555,"UIDs":[5555]}' - "99999": '{"GID":99999,"UIDs":[2222,3333,4444,5555]}' -UserByID: - "1111": '{"Name":"userwithbroker","UID":1111,"GID":11111,"Gecos":"userwithbroker gecos\nOn multiple lines","Dir":"/home/userwithbroker","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' - "2222": '{"Name":"userwithinactivebroker","UID":2222,"GID":22222,"Gecos":"userwithinactivebroker","Dir":"/home/userwithinactivebroker","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - "3333": '{"Name":"userlocalbroker","UID":3333,"GID":33333,"Gecos":"userlocalbroker","Dir":"/home/userlocalbroker","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' - "4444": '{"Name":"usersetbroker","UID":4444,"GID":44444,"Gecos":"usersetbroker","Dir":"/home/usersetbroker","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2004-04-04T04:04:04Z"}' - "5555": '{"Name":"userupdatebroker","UID":5555,"GID":55555,"Gecos":"userupdatebroker","Dir":"/home/userupdatebroker","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2005-05-05T05:05:05Z"}' -UserByName: - userlocalbroker: '{"Name":"userlocalbroker","UID":3333,"GID":33333,"Gecos":"userlocalbroker","Dir":"/home/userlocalbroker","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' - usersetbroker: '{"Name":"usersetbroker","UID":4444,"GID":44444,"Gecos":"usersetbroker","Dir":"/home/usersetbroker","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2004-04-04T04:04:04Z"}' - userupdatebroker: '{"Name":"userupdatebroker","UID":5555,"GID":55555,"Gecos":"userupdatebroker","Dir":"/home/userupdatebroker","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2005-05-05T05:05:05Z"}' - userwithbroker: '{"Name":"userwithbroker","UID":1111,"GID":11111,"Gecos":"userwithbroker gecos\nOn multiple lines","Dir":"/home/userwithbroker","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' - userwithinactivebroker: '{"Name":"userwithinactivebroker","UID":2222,"GID":22222,"Gecos":"userwithinactivebroker","Dir":"/home/userwithinactivebroker","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' -UserToBroker: - "1111": '"broker-id"' - "2222": '"inactive-broker-id"' - "5555": '"1902181170"' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11111]}' - "2222": '{"UID":2222,"GIDs":[22222,99999]}' - "3333": '{"UID":3333,"GIDs":[33333,99999]}' - "4444": '{"UID":4444,"GIDs":[44444,99999]}' - "5555": '{"UID":5555,"GIDs":[55555,99999]}' -UserToLocalGroups: {} +users: + - name: userwithbroker + uid: 1111 + gid: 11111 + gecos: |- + userwithbroker gecos + On multiple lines + home: /home/userwithbroker + shell: /bin/bash + broker_id: broker-id + last_login: 2001-01-01T01:01:01Z + - name: userwithinactivebroker + uid: 2222 + gid: 22222 + gecos: userwithinactivebroker + home: /home/userwithinactivebroker + shell: /bin/dash + broker_id: inactive-broker-id + last_login: 2002-02-02T02:02:02Z + - name: userlocalbroker + uid: 3333 + gid: 33333 + gecos: userlocalbroker + home: /home/userlocalbroker + shell: /bin/zsh + last_login: 2003-03-03T03:03:03Z + - name: usersetbroker + uid: 4444 + gid: 44444 + gecos: usersetbroker + home: /home/usersetbroker + shell: /bin/dash + last_login: 2004-04-04T04:04:04Z + - name: userupdatebroker + uid: 5555 + gid: 55555 + gecos: userupdatebroker + home: /home/userupdatebroker + shell: /bin/zsh + broker_id: "1902181170" + last_login: 2005-05-05T05:05:05Z +groups: + - name: group1 + gid: 11111 + ugid: group1 + - name: group2 + gid: 22222 + ugid: group2 + - name: group3 + gid: 33333 + ugid: group3 + - name: group4 + gid: 44444 + ugid: group4 + - name: group5 + gid: 55555 + ugid: group5 + - name: commongroup + gid: 99999 + ugid: commongroup +users_to_groups: + - uid: 1111 + gid: 11111 + - uid: 2222 + gid: 22222 + - uid: 2222 + gid: 99999 + - uid: 3333 + gid: 33333 + - uid: 3333 + gid: 99999 + - uid: 4444 + gid: 44444 + - uid: 4444 + gid: 99999 + - uid: 5555 + gid: 55555 + - uid: 5555 + gid: 99999 diff --git a/internal/users/db/testdata/golden/TestAllUsers/Get_multiple_users b/internal/users/db/testdata/golden/TestAllUsers/Get_multiple_users index 16e8b4f41..9b9806336 100644 --- a/internal/users/db/testdata/golden/TestAllUsers/Get_multiple_users +++ b/internal/users/db/testdata/golden/TestAllUsers/Get_multiple_users @@ -4,47 +4,26 @@ gecos: |- User1 gecos On multiple lines - dir: /home/user1 + home: /home/user1 shell: /bin/bash - lastpwdchange: -1 - maxpwdage: -1 - pwdwarnperiod: -1 - pwdinactivity: -1 - minpwdage: -1 - expirationdate: -1 + broker_id: broker-id - name: user2 uid: 2222 gid: 22222 gecos: User2 - dir: /home/user2 + home: /home/user2 shell: /bin/dash - lastpwdchange: -1 - maxpwdage: -1 - pwdwarnperiod: -1 - pwdinactivity: -1 - minpwdage: -1 - expirationdate: -1 + broker_id: broker-id - name: user3 uid: 3333 gid: 33333 gecos: User3 - dir: /home/user3 + home: /home/user3 shell: /bin/zsh - lastpwdchange: -1 - maxpwdage: -1 - pwdwarnperiod: -1 - pwdinactivity: -1 - minpwdage: -1 - expirationdate: -1 + broker_id: broker-id - name: userwithoutbroker uid: 4444 gid: 44444 gecos: userwithoutbroker - dir: /home/userwithoutbroker + home: /home/userwithoutbroker shell: /bin/sh - lastpwdchange: -1 - maxpwdage: -1 - pwdwarnperiod: -1 - pwdinactivity: -1 - minpwdage: -1 - expirationdate: -1 diff --git a/internal/users/db/testdata/golden/TestAllUsers/Get_one_user b/internal/users/db/testdata/golden/TestAllUsers/Get_one_user index 22e997713..8b837c4b0 100644 --- a/internal/users/db/testdata/golden/TestAllUsers/Get_one_user +++ b/internal/users/db/testdata/golden/TestAllUsers/Get_one_user @@ -4,11 +4,6 @@ gecos: |- User1 gecos On multiple lines - dir: /home/user1 + home: /home/user1 shell: /bin/bash - lastpwdchange: -1 - maxpwdage: -1 - pwdwarnperiod: -1 - pwdinactivity: -1 - minpwdage: -1 - expirationdate: -1 + broker_id: broker-id diff --git a/internal/users/db/testdata/golden/TestDeleteUser/Deleting_existing_user_keeps_other_group_members_intact b/internal/users/db/testdata/golden/TestDeleteUser/Deleting_existing_user_keeps_other_group_members_intact index 3539fe13f..026f6b60f 100644 --- a/internal/users/db/testdata/golden/TestDeleteUser/Deleting_existing_user_keeps_other_group_members_intact +++ b/internal/users/db/testdata/golden/TestDeleteUser/Deleting_existing_user_keeps_other_group_members_intact @@ -1,40 +1,53 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - "22222": '{"Name":"group2","GID":22222,"UGID":"56781234"}' - "33333": '{"Name":"group3","GID":33333,"UGID":"34567812"}' - "44444": '{"Name":"group4","GID":44444,"UGID":"45678123"}' - "99999": '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' -GroupByName: - commongroup: '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' - group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' - group2: '{"Name":"group2","GID":22222,"UGID":"56781234"}' - group3: '{"Name":"group3","GID":33333,"UGID":"34567812"}' - group4: '{"Name":"group4","GID":44444,"UGID":"45678123"}' -GroupByUGID: - "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - "34567812": '{"Name":"group3","GID":33333,"UGID":"34567812"}' - "45678123": '{"Name":"group4","GID":44444,"UGID":"45678123"}' - "56781234": '{"Name":"group2","GID":22222,"UGID":"56781234"}' - "87654321": '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[]}' - "22222": '{"GID":22222,"UIDs":[2222]}' - "33333": '{"GID":33333,"UIDs":[3333]}' - "44444": '{"GID":33333,"UIDs":[4444]}' - "99999": '{"GID":99999,"UIDs":[2222,3333,4444]}' -UserByID: - "2222": '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - "3333": '{"Name":"user3","UID":3333,"GID":33333,"Gecos":"User3","Dir":"/home/user3","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' - "4444": '{"Name":"userwithoutbroker","UID":4444,"GID":44444,"Gecos":"userwithoutbroker","Dir":"/home/userwithoutbroker","Shell":"/bin/sh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2004-04-04T04:04:04Z"}' -UserByName: - user2: '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - user3: '{"Name":"user3","UID":3333,"GID":33333,"Gecos":"User3","Dir":"/home/user3","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' - userwithoutbroker: '{"Name":"userwithoutbroker","UID":4444,"GID":44444,"Gecos":"userwithoutbroker","Dir":"/home/userwithoutbroker","Shell":"/bin/sh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2004-04-04T04:04:04Z"}' -UserToBroker: - "2222": '"broker-id"' - "3333": '"broker-id"' -UserToGroups: - "2222": '{"UID":2222,"GIDs":[22222,99999]}' - "3333": '{"UID":3333,"GIDs":[33333,99999]}' - "4444": '{"UID":4444,"GIDs":[44444,99999]}' -UserToLocalGroups: {} +users: + - name: user2 + uid: 2222 + gid: 22222 + gecos: User2 + home: /home/user2 + shell: /bin/dash + broker_id: broker-id + last_login: 2002-02-02T02:02:02Z + - name: user3 + uid: 3333 + gid: 33333 + gecos: User3 + home: /home/user3 + shell: /bin/zsh + broker_id: broker-id + last_login: 2003-03-03T03:03:03Z + - name: userwithoutbroker + uid: 4444 + gid: 44444 + gecos: userwithoutbroker + home: /home/userwithoutbroker + shell: /bin/sh + last_login: 2004-04-04T04:04:04Z +groups: + - name: group1 + gid: 11111 + ugid: "12345678" + - name: group2 + gid: 22222 + ugid: "56781234" + - name: group3 + gid: 33333 + ugid: "34567812" + - name: group4 + gid: 44444 + ugid: "45678123" + - name: commongroup + gid: 99999 + ugid: "87654321" +users_to_groups: + - uid: 2222 + gid: 22222 + - uid: 2222 + gid: 99999 + - uid: 3333 + gid: 33333 + - uid: 3333 + gid: 99999 + - uid: 4444 + gid: 44444 + - uid: 4444 + gid: 99999 diff --git a/internal/users/db/testdata/golden/TestDeleteUser/Deleting_last_user_from_a_group_keeps_the_group_record b/internal/users/db/testdata/golden/TestDeleteUser/Deleting_last_user_from_a_group_keeps_the_group_record index 4d53cbd4c..4a969d278 100644 --- a/internal/users/db/testdata/golden/TestDeleteUser/Deleting_last_user_from_a_group_keeps_the_group_record +++ b/internal/users/db/testdata/golden/TestDeleteUser/Deleting_last_user_from_a_group_keeps_the_group_record @@ -1,13 +1,6 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupByName: - group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupByUGID: - "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[]}' -UserByID: {} -UserByName: {} -UserToBroker: {} -UserToGroups: {} -UserToLocalGroups: {} +users: [] +groups: + - name: group1 + gid: 11111 + ugid: "12345678" +users_to_groups: [] diff --git a/internal/users/db/testdata/golden/TestNew/New_with_already_existing_database b/internal/users/db/testdata/golden/TestNew/New_with_already_existing_database index 0e7bf1a06..16246e989 100644 --- a/internal/users/db/testdata/golden/TestNew/New_with_already_existing_database +++ b/internal/users/db/testdata/golden/TestNew/New_with_already_existing_database @@ -1,44 +1,67 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - "22222": '{"Name":"group2","GID":22222,"UGID":"56781234"}' - "33333": '{"Name":"group3","GID":33333,"UGID":"34567812"}' - "44444": '{"Name":"group4","GID":44444,"UGID":"45678123"}' - "99999": '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' -GroupByName: - commongroup: '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' - group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' - group2: '{"Name":"group2","GID":22222,"UGID":"56781234"}' - group3: '{"Name":"group3","GID":33333,"UGID":"34567812"}' - group4: '{"Name":"group4","GID":44444,"UGID":"45678123"}' -GroupByUGID: - "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - "34567812": '{"Name":"group3","GID":33333,"UGID":"34567812"}' - "45678123": '{"Name":"group4","GID":44444,"UGID":"45678123"}' - "56781234": '{"Name":"group2","GID":22222,"UGID":"56781234"}' - "87654321": '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' - "22222": '{"GID":22222,"UIDs":[2222]}' - "33333": '{"GID":33333,"UIDs":[3333]}' - "44444": '{"GID":33333,"UIDs":[4444]}' - "99999": '{"GID":99999,"UIDs":[1111,2222,3333,4444]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' - "2222": '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - "3333": '{"Name":"user3","UID":3333,"GID":33333,"Gecos":"User3","Dir":"/home/user3","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' - "4444": '{"Name":"userwithoutbroker","UID":4444,"GID":44444,"Gecos":"userwithoutbroker","Dir":"/home/userwithoutbroker","Shell":"/bin/sh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2004-04-04T04:04:04Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' - user2: '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - user3: '{"Name":"user3","UID":3333,"GID":33333,"Gecos":"User3","Dir":"/home/user3","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' - userwithoutbroker: '{"Name":"userwithoutbroker","UID":4444,"GID":44444,"Gecos":"userwithoutbroker","Dir":"/home/userwithoutbroker","Shell":"/bin/sh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2004-04-04T04:04:04Z"}' -UserToBroker: - "1111": '"broker-id"' - "2222": '"broker-id"' - "3333": '"broker-id"' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11111,99999]}' - "2222": '{"UID":2222,"GIDs":[22222,99999]}' - "3333": '{"UID":3333,"GIDs":[33333,99999]}' - "4444": '{"UID":4444,"GIDs":[44444,99999]}' -UserToLocalGroups: {} +users: + - name: user1 + uid: 1111 + gid: 11111 + gecos: |- + User1 gecos + On multiple lines + home: /home/user1 + shell: /bin/bash + broker_id: broker-id + last_login: 2001-01-01T01:01:01Z + - name: user2 + uid: 2222 + gid: 22222 + gecos: User2 + home: /home/user2 + shell: /bin/dash + broker_id: broker-id + last_login: 2002-02-02T02:02:02Z + - name: user3 + uid: 3333 + gid: 33333 + gecos: User3 + home: /home/user3 + shell: /bin/zsh + broker_id: broker-id + last_login: 2003-03-03T03:03:03Z + - name: userwithoutbroker + uid: 4444 + gid: 44444 + gecos: userwithoutbroker + home: /home/userwithoutbroker + shell: /bin/sh + last_login: 2004-04-04T04:04:04Z +groups: + - name: group1 + gid: 11111 + ugid: "12345678" + - name: group2 + gid: 22222 + ugid: "56781234" + - name: group3 + gid: 33333 + ugid: "34567812" + - name: group4 + gid: 44444 + ugid: "45678123" + - name: commongroup + gid: 99999 + ugid: "87654321" +users_to_groups: + - uid: 1111 + gid: 11111 + - uid: 1111 + gid: 99999 + - uid: 2222 + gid: 22222 + - uid: 2222 + gid: 99999 + - uid: 3333 + gid: 33333 + - uid: 3333 + gid: 99999 + - uid: 4444 + gid: 44444 + - uid: 4444 + gid: 99999 diff --git a/internal/users/db/testdata/golden/TestNew/New_without_any_initialized_database b/internal/users/db/testdata/golden/TestNew/New_without_any_initialized_database index 79f78e127..b4e430668 100644 --- a/internal/users/db/testdata/golden/TestNew/New_without_any_initialized_database +++ b/internal/users/db/testdata/golden/TestNew/New_without_any_initialized_database @@ -1,9 +1,3 @@ -GroupByID: {} -GroupByName: {} -GroupByUGID: {} -GroupToUsers: {} -UserByID: {} -UserByName: {} -UserToBroker: {} -UserToGroups: {} -UserToLocalGroups: {} +users: [] +groups: [] +users_to_groups: [] diff --git a/internal/users/db/testdata/golden/TestUpdateUserEntry/Add_user_to_group_from_another_user b/internal/users/db/testdata/golden/TestUpdateUserEntry/Add_user_to_group_from_another_user index e1f1aa06f..383cfc051 100644 --- a/internal/users/db/testdata/golden/TestUpdateUserEntry/Add_user_to_group_from_another_user +++ b/internal/users/db/testdata/golden/TestUpdateUserEntry/Add_user_to_group_from_another_user @@ -1,45 +1,66 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - "22222": '{"Name":"group2","GID":22222,"UGID":"56781234"}' - "33333": '{"Name":"group3","GID":33333,"UGID":"34567812"}' - "44444": '{"Name":"group4","GID":44444,"UGID":"45678123"}' - "99999": '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' -GroupByName: - commongroup: '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' - group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' - group2: '{"Name":"group2","GID":22222,"UGID":"56781234"}' - group3: '{"Name":"group3","GID":33333,"UGID":"34567812"}' - group4: '{"Name":"group4","GID":44444,"UGID":"45678123"}' -GroupByUGID: - "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - "34567812": '{"Name":"group3","GID":33333,"UGID":"34567812"}' - "45678123": '{"Name":"group4","GID":44444,"UGID":"45678123"}' - "56781234": '{"Name":"group2","GID":22222,"UGID":"56781234"}' - "87654321": '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' - "22222": '{"GID":22222,"UIDs":[2222,1111]}' - "33333": '{"GID":33333,"UIDs":[3333]}' - "44444": '{"GID":33333,"UIDs":[4444]}' - "99999": '{"GID":99999,"UIDs":[2222,3333,4444]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' - "2222": '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - "3333": '{"Name":"user3","UID":3333,"GID":33333,"Gecos":"User3","Dir":"/home/user3","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' - "4444": '{"Name":"userwithoutbroker","UID":4444,"GID":44444,"Gecos":"userwithoutbroker","Dir":"/home/userwithoutbroker","Shell":"/bin/sh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2004-04-04T04:04:04Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' - user2: '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - user3: '{"Name":"user3","UID":3333,"GID":33333,"Gecos":"User3","Dir":"/home/user3","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' - userwithoutbroker: '{"Name":"userwithoutbroker","UID":4444,"GID":44444,"Gecos":"userwithoutbroker","Dir":"/home/userwithoutbroker","Shell":"/bin/sh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2004-04-04T04:04:04Z"}' -UserToBroker: - "1111": '"broker-id"' - "2222": '"broker-id"' - "3333": '"broker-id"' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11111,22222]}' - "2222": '{"UID":2222,"GIDs":[22222,99999]}' - "3333": '{"UID":3333,"GIDs":[33333,99999]}' - "4444": '{"UID":4444,"GIDs":[44444,99999]}' -UserToLocalGroups: - "1111": "null" +users: + - name: user1 + uid: 1111 + gid: 11111 + gecos: |- + User1 gecos + On multiple lines + home: /home/user1 + shell: /bin/bash + last_login: 2020-01-01T00:00:00Z + - name: user2 + uid: 2222 + gid: 22222 + gecos: User2 + home: /home/user2 + shell: /bin/dash + broker_id: broker-id + last_login: 2002-02-02T02:02:02Z + - name: user3 + uid: 3333 + gid: 33333 + gecos: User3 + home: /home/user3 + shell: /bin/zsh + broker_id: broker-id + last_login: 2003-03-03T03:03:03Z + - name: userwithoutbroker + uid: 4444 + gid: 44444 + gecos: userwithoutbroker + home: /home/userwithoutbroker + shell: /bin/sh + last_login: 2004-04-04T04:04:04Z +groups: + - name: group1 + gid: 11111 + ugid: "12345678" + - name: group2 + gid: 22222 + ugid: "56781234" + - name: group3 + gid: 33333 + ugid: "34567812" + - name: group4 + gid: 44444 + ugid: "45678123" + - name: commongroup + gid: 99999 + ugid: "87654321" +users_to_groups: + - uid: 1111 + gid: 11111 + - uid: 1111 + gid: 22222 + - uid: 2222 + gid: 22222 + - uid: 2222 + gid: 99999 + - uid: 3333 + gid: 33333 + - uid: 3333 + gid: 99999 + - uid: 4444 + gid: 44444 + - uid: 4444 + gid: 99999 diff --git a/internal/users/db/testdata/golden/TestUpdateUserEntry/Insert_new_user b/internal/users/db/testdata/golden/TestUpdateUserEntry/Insert_new_user index 0034f94ba..45d96354d 100644 --- a/internal/users/db/testdata/golden/TestUpdateUserEntry/Insert_new_user +++ b/internal/users/db/testdata/golden/TestUpdateUserEntry/Insert_new_user @@ -1,17 +1,17 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupByName: - group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupByUGID: - "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserToBroker: {} -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11111]}' -UserToLocalGroups: - "1111": "null" +users: + - name: user1 + uid: 1111 + gid: 11111 + gecos: |- + User1 gecos + On multiple lines + home: /home/user1 + shell: /bin/bash + last_login: 2020-01-01T00:00:00Z +groups: + - name: group1 + gid: 11111 + ugid: "12345678" +users_to_groups: + - uid: 1111 + gid: 11111 diff --git a/internal/users/db/testdata/golden/TestUpdateUserEntry/Insert_new_user_without_optional_gecos_field b/internal/users/db/testdata/golden/TestUpdateUserEntry/Insert_new_user_without_optional_gecos_field index 9289db157..25c451c7d 100644 --- a/internal/users/db/testdata/golden/TestUpdateUserEntry/Insert_new_user_without_optional_gecos_field +++ b/internal/users/db/testdata/golden/TestUpdateUserEntry/Insert_new_user_without_optional_gecos_field @@ -1,17 +1,15 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupByName: - group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupByUGID: - "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserToBroker: {} -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11111]}' -UserToLocalGroups: - "1111": "null" +users: + - name: user1 + uid: 1111 + gid: 11111 + gecos: "" + home: /home/user1 + shell: /bin/bash + last_login: 2020-01-01T00:00:00Z +groups: + - name: group1 + gid: 11111 + ugid: "12345678" +users_to_groups: + - uid: 1111 + gid: 11111 diff --git a/internal/users/db/testdata/golden/TestUpdateUserEntry/Remove_group_from_user b/internal/users/db/testdata/golden/TestUpdateUserEntry/Remove_group_from_user index eee882126..2bf55435a 100644 --- a/internal/users/db/testdata/golden/TestUpdateUserEntry/Remove_group_from_user +++ b/internal/users/db/testdata/golden/TestUpdateUserEntry/Remove_group_from_user @@ -1,22 +1,20 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - "22222": '{"Name":"group2","GID":22222,"UGID":"56781234"}' -GroupByName: - group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' - group2: '{"Name":"group2","GID":22222,"UGID":"56781234"}' -GroupByUGID: - "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - "56781234": '{"Name":"group2","GID":22222,"UGID":"56781234"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[]}' - "22222": '{"GID":22222,"UIDs":[1111]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":22222,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":22222,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserToBroker: - "1111": '"broker-id"' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[22222]}' -UserToLocalGroups: - "1111": "null" +users: + - name: user1 + uid: 1111 + gid: 22222 + gecos: |- + User1 gecos + On multiple lines + home: /home/user1 + shell: /bin/bash + last_login: 2020-01-01T00:00:00Z +groups: + - name: group1 + gid: 11111 + ugid: "12345678" + - name: group2 + gid: 22222 + ugid: "56781234" +users_to_groups: + - uid: 1111 + gid: 22222 diff --git a/internal/users/db/testdata/golden/TestUpdateUserEntry/Remove_user_from_a_group_still_part_from_another_user b/internal/users/db/testdata/golden/TestUpdateUserEntry/Remove_user_from_a_group_still_part_from_another_user index 4bed2ddca..1bad0cbd2 100644 --- a/internal/users/db/testdata/golden/TestUpdateUserEntry/Remove_user_from_a_group_still_part_from_another_user +++ b/internal/users/db/testdata/golden/TestUpdateUserEntry/Remove_user_from_a_group_still_part_from_another_user @@ -1,45 +1,64 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - "22222": '{"Name":"group2","GID":22222,"UGID":"56781234"}' - "33333": '{"Name":"group3","GID":33333,"UGID":"34567812"}' - "44444": '{"Name":"group4","GID":44444,"UGID":"45678123"}' - "99999": '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' -GroupByName: - commongroup: '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' - group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' - group2: '{"Name":"group2","GID":22222,"UGID":"56781234"}' - group3: '{"Name":"group3","GID":33333,"UGID":"34567812"}' - group4: '{"Name":"group4","GID":44444,"UGID":"45678123"}' -GroupByUGID: - "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - "34567812": '{"Name":"group3","GID":33333,"UGID":"34567812"}' - "45678123": '{"Name":"group4","GID":44444,"UGID":"45678123"}' - "56781234": '{"Name":"group2","GID":22222,"UGID":"56781234"}' - "87654321": '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' - "22222": '{"GID":22222,"UIDs":[2222]}' - "33333": '{"GID":33333,"UIDs":[3333]}' - "44444": '{"GID":33333,"UIDs":[4444]}' - "99999": '{"GID":99999,"UIDs":[1111,2222,4444]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' - "2222": '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - "3333": '{"Name":"user3","UID":3333,"GID":33333,"Gecos":"User3 gecos","Dir":"/home/user3","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' - "4444": '{"Name":"userwithoutbroker","UID":4444,"GID":44444,"Gecos":"userwithoutbroker","Dir":"/home/userwithoutbroker","Shell":"/bin/sh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2004-04-04T04:04:04Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' - user2: '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - user3: '{"Name":"user3","UID":3333,"GID":33333,"Gecos":"User3 gecos","Dir":"/home/user3","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' - userwithoutbroker: '{"Name":"userwithoutbroker","UID":4444,"GID":44444,"Gecos":"userwithoutbroker","Dir":"/home/userwithoutbroker","Shell":"/bin/sh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2004-04-04T04:04:04Z"}' -UserToBroker: - "1111": '"broker-id"' - "2222": '"broker-id"' - "3333": '"broker-id"' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11111,99999]}' - "2222": '{"UID":2222,"GIDs":[22222,99999]}' - "3333": '{"UID":3333,"GIDs":[33333]}' - "4444": '{"UID":4444,"GIDs":[44444,99999]}' -UserToLocalGroups: - "3333": "null" +users: + - name: user1 + uid: 1111 + gid: 11111 + gecos: |- + User1 gecos + On multiple lines + home: /home/user1 + shell: /bin/bash + broker_id: broker-id + last_login: 2001-01-01T01:01:01Z + - name: user2 + uid: 2222 + gid: 22222 + gecos: User2 + home: /home/user2 + shell: /bin/dash + broker_id: broker-id + last_login: 2002-02-02T02:02:02Z + - name: user3 + uid: 3333 + gid: 33333 + gecos: User3 gecos + home: /home/user3 + shell: /bin/zsh + last_login: 2020-01-01T00:00:00Z + - name: userwithoutbroker + uid: 4444 + gid: 44444 + gecos: userwithoutbroker + home: /home/userwithoutbroker + shell: /bin/sh + last_login: 2004-04-04T04:04:04Z +groups: + - name: group1 + gid: 11111 + ugid: "12345678" + - name: group2 + gid: 22222 + ugid: "56781234" + - name: group3 + gid: 33333 + ugid: "34567812" + - name: group4 + gid: 44444 + ugid: "45678123" + - name: commongroup + gid: 99999 + ugid: "87654321" +users_to_groups: + - uid: 1111 + gid: 11111 + - uid: 1111 + gid: 99999 + - uid: 2222 + gid: 22222 + - uid: 2222 + gid: 99999 + - uid: 3333 + gid: 33333 + - uid: 4444 + gid: 44444 + - uid: 4444 + gid: 99999 diff --git a/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_last_login_time_for_user b/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_last_login_time_for_user index d0618e2fe..45d96354d 100644 --- a/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_last_login_time_for_user +++ b/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_last_login_time_for_user @@ -1,18 +1,17 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupByName: - group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupByUGID: - "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserToBroker: - "1111": '"broker-id"' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11111]}' -UserToLocalGroups: - "1111": "null" +users: + - name: user1 + uid: 1111 + gid: 11111 + gecos: |- + User1 gecos + On multiple lines + home: /home/user1 + shell: /bin/bash + last_login: 2020-01-01T00:00:00Z +groups: + - name: group1 + gid: 11111 + ugid: "12345678" +users_to_groups: + - uid: 1111 + gid: 11111 diff --git a/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_only_user_even_if_we_have_multiple_of_them b/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_only_user_even_if_we_have_multiple_of_them index 20515021e..089b44ac3 100644 --- a/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_only_user_even_if_we_have_multiple_of_them +++ b/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_only_user_even_if_we_have_multiple_of_them @@ -1,45 +1,64 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - "22222": '{"Name":"group2","GID":22222,"UGID":"56781234"}' - "33333": '{"Name":"group3","GID":33333,"UGID":"34567812"}' - "44444": '{"Name":"group4","GID":44444,"UGID":"45678123"}' - "99999": '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' -GroupByName: - commongroup: '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' - group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' - group2: '{"Name":"group2","GID":22222,"UGID":"56781234"}' - group3: '{"Name":"group3","GID":33333,"UGID":"34567812"}' - group4: '{"Name":"group4","GID":44444,"UGID":"45678123"}' -GroupByUGID: - "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - "34567812": '{"Name":"group3","GID":33333,"UGID":"34567812"}' - "45678123": '{"Name":"group4","GID":44444,"UGID":"45678123"}' - "56781234": '{"Name":"group2","GID":22222,"UGID":"56781234"}' - "87654321": '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' - "22222": '{"GID":22222,"UIDs":[2222]}' - "33333": '{"GID":33333,"UIDs":[3333]}' - "44444": '{"GID":33333,"UIDs":[4444]}' - "99999": '{"GID":99999,"UIDs":[2222,3333,4444]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' - "2222": '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - "3333": '{"Name":"user3","UID":3333,"GID":33333,"Gecos":"User3","Dir":"/home/user3","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' - "4444": '{"Name":"userwithoutbroker","UID":4444,"GID":44444,"Gecos":"userwithoutbroker","Dir":"/home/userwithoutbroker","Shell":"/bin/sh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2004-04-04T04:04:04Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' - user2: '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - user3: '{"Name":"user3","UID":3333,"GID":33333,"Gecos":"User3","Dir":"/home/user3","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' - userwithoutbroker: '{"Name":"userwithoutbroker","UID":4444,"GID":44444,"Gecos":"userwithoutbroker","Dir":"/home/userwithoutbroker","Shell":"/bin/sh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2004-04-04T04:04:04Z"}' -UserToBroker: - "1111": '"broker-id"' - "2222": '"broker-id"' - "3333": '"broker-id"' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11111]}' - "2222": '{"UID":2222,"GIDs":[22222,99999]}' - "3333": '{"UID":3333,"GIDs":[33333,99999]}' - "4444": '{"UID":4444,"GIDs":[44444,99999]}' -UserToLocalGroups: - "1111": "null" +users: + - name: user1 + uid: 1111 + gid: 11111 + gecos: |- + User1 gecos + On multiple lines + home: /home/user1 + shell: /bin/bash + last_login: 2020-01-01T00:00:00Z + - name: user2 + uid: 2222 + gid: 22222 + gecos: User2 + home: /home/user2 + shell: /bin/dash + broker_id: broker-id + last_login: 2002-02-02T02:02:02Z + - name: user3 + uid: 3333 + gid: 33333 + gecos: User3 + home: /home/user3 + shell: /bin/zsh + broker_id: broker-id + last_login: 2003-03-03T03:03:03Z + - name: userwithoutbroker + uid: 4444 + gid: 44444 + gecos: userwithoutbroker + home: /home/userwithoutbroker + shell: /bin/sh + last_login: 2004-04-04T04:04:04Z +groups: + - name: group1 + gid: 11111 + ugid: "12345678" + - name: group2 + gid: 22222 + ugid: "56781234" + - name: group3 + gid: 33333 + ugid: "34567812" + - name: group4 + gid: 44444 + ugid: "45678123" + - name: commongroup + gid: 99999 + ugid: "87654321" +users_to_groups: + - uid: 1111 + gid: 11111 + - uid: 2222 + gid: 22222 + - uid: 2222 + gid: 99999 + - uid: 3333 + gid: 33333 + - uid: 3333 + gid: 99999 + - uid: 4444 + gid: 44444 + - uid: 4444 + gid: 99999 diff --git a/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_user_by_adding_a_new_default_group b/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_user_by_adding_a_new_default_group index b9999dc93..a2e80e424 100644 --- a/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_user_by_adding_a_new_default_group +++ b/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_user_by_adding_a_new_default_group @@ -1,22 +1,22 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - "22222": '{"Name":"group2","GID":22222,"UGID":"56781234"}' -GroupByName: - group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' - group2: '{"Name":"group2","GID":22222,"UGID":"56781234"}' -GroupByUGID: - "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - "56781234": '{"Name":"group2","GID":22222,"UGID":"56781234"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' - "22222": '{"GID":22222,"UIDs":[1111]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":22222,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":22222,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserToBroker: - "1111": '"broker-id"' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[22222,11111]}' -UserToLocalGroups: - "1111": "null" +users: + - name: user1 + uid: 1111 + gid: 22222 + gecos: |- + User1 gecos + On multiple lines + home: /home/user1 + shell: /bin/bash + last_login: 2020-01-01T00:00:00Z +groups: + - name: group1 + gid: 11111 + ugid: "12345678" + - name: group2 + gid: 22222 + ugid: "56781234" +users_to_groups: + - uid: 1111 + gid: 11111 + - uid: 1111 + gid: 22222 diff --git a/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_user_by_adding_a_new_group b/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_user_by_adding_a_new_group index 731547ce7..020f5f177 100644 --- a/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_user_by_adding_a_new_group +++ b/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_user_by_adding_a_new_group @@ -1,22 +1,22 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - "22222": '{"Name":"group2","GID":22222,"UGID":"56781234"}' -GroupByName: - group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' - group2: '{"Name":"group2","GID":22222,"UGID":"56781234"}' -GroupByUGID: - "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - "56781234": '{"Name":"group2","GID":22222,"UGID":"56781234"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' - "22222": '{"GID":22222,"UIDs":[1111]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserToBroker: - "1111": '"broker-id"' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11111,22222]}' -UserToLocalGroups: - "1111": "null" +users: + - name: user1 + uid: 1111 + gid: 11111 + gecos: |- + User1 gecos + On multiple lines + home: /home/user1 + shell: /bin/bash + last_login: 2020-01-01T00:00:00Z +groups: + - name: group1 + gid: 11111 + ugid: "12345678" + - name: group2 + gid: 22222 + ugid: "56781234" +users_to_groups: + - uid: 1111 + gid: 11111 + - uid: 1111 + gid: 22222 diff --git a/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_user_by_adding_a_new_local_group b/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_user_by_adding_a_new_local_group index 370f34b99..45d96354d 100644 --- a/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_user_by_adding_a_new_local_group +++ b/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_user_by_adding_a_new_local_group @@ -1,18 +1,17 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupByName: - group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupByUGID: - "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserToBroker: - "1111": '"broker-id"' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11111]}' -UserToLocalGroups: - "1111": '["localgroup1"]' +users: + - name: user1 + uid: 1111 + gid: 11111 + gecos: |- + User1 gecos + On multiple lines + home: /home/user1 + shell: /bin/bash + last_login: 2020-01-01T00:00:00Z +groups: + - name: group1 + gid: 11111 + ugid: "12345678" +users_to_groups: + - uid: 1111 + gid: 11111 diff --git a/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_user_by_changing_attributes b/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_user_by_changing_attributes index 0b7465cac..62dc1afb6 100644 --- a/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_user_by_changing_attributes +++ b/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_user_by_changing_attributes @@ -1,18 +1,15 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupByName: - group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupByUGID: - "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"New user1 gecos","Dir":"/home/user1","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"New user1 gecos","Dir":"/home/user1","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserToBroker: - "1111": '"broker-id"' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11111]}' -UserToLocalGroups: - "1111": "null" +users: + - name: user1 + uid: 1111 + gid: 11111 + gecos: New user1 gecos + home: /home/user1 + shell: /bin/dash + last_login: 2020-01-01T00:00:00Z +groups: + - name: group1 + gid: 11111 + ugid: "12345678" +users_to_groups: + - uid: 1111 + gid: 11111 diff --git a/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_user_by_removing_optional_gecos_field_if_not_set b/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_user_by_removing_optional_gecos_field_if_not_set index 6f24f13bf..25c451c7d 100644 --- a/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_user_by_removing_optional_gecos_field_if_not_set +++ b/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_user_by_removing_optional_gecos_field_if_not_set @@ -1,18 +1,15 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupByName: - group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupByUGID: - "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserToBroker: - "1111": '"broker-id"' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11111]}' -UserToLocalGroups: - "1111": "null" +users: + - name: user1 + uid: 1111 + gid: 11111 + gecos: "" + home: /home/user1 + shell: /bin/bash + last_login: 2020-01-01T00:00:00Z +groups: + - name: group1 + gid: 11111 + ugid: "12345678" +users_to_groups: + - uid: 1111 + gid: 11111 diff --git a/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_user_by_renaming_a_group b/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_user_by_renaming_a_group index 44c9be2fd..e9260682d 100644 --- a/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_user_by_renaming_a_group +++ b/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_user_by_renaming_a_group @@ -1,18 +1,17 @@ -GroupByID: - "11111": '{"Name":"newgroup1-same-ugid","GID":11111,"UGID":"12345678"}' -GroupByName: - newgroup1-same-ugid: '{"Name":"newgroup1-same-ugid","GID":11111,"UGID":"12345678"}' -GroupByUGID: - "12345678": '{"Name":"newgroup1-same-ugid","GID":11111,"UGID":"12345678"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserToBroker: - "1111": '"broker-id"' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11111]}' -UserToLocalGroups: - "1111": "null" +users: + - name: user1 + uid: 1111 + gid: 11111 + gecos: |- + User1 gecos + On multiple lines + home: /home/user1 + shell: /bin/bash + last_login: 2020-01-01T00:00:00Z +groups: + - name: newgroup1-same-ugid + gid: 11111 + ugid: "12345678" +users_to_groups: + - uid: 1111 + gid: 11111 diff --git a/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_user_does_not_change_homedir_if_it_exists b/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_user_does_not_change_homedir_if_it_exists index d0618e2fe..45d96354d 100644 --- a/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_user_does_not_change_homedir_if_it_exists +++ b/internal/users/db/testdata/golden/TestUpdateUserEntry/Update_user_does_not_change_homedir_if_it_exists @@ -1,18 +1,17 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupByName: - group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupByUGID: - "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserToBroker: - "1111": '"broker-id"' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11111]}' -UserToLocalGroups: - "1111": "null" +users: + - name: user1 + uid: 1111 + gid: 11111 + gecos: |- + User1 gecos + On multiple lines + home: /home/user1 + shell: /bin/bash + last_login: 2020-01-01T00:00:00Z +groups: + - name: group1 + gid: 11111 + ugid: "12345678" +users_to_groups: + - uid: 1111 + gid: 11111 diff --git a/internal/users/db/testdata/golden/TestUserByID/Get_existing_user b/internal/users/db/testdata/golden/TestUserByID/Get_existing_user index ae9003a06..589296533 100644 --- a/internal/users/db/testdata/golden/TestUserByID/Get_existing_user +++ b/internal/users/db/testdata/golden/TestUserByID/Get_existing_user @@ -4,11 +4,6 @@ gid: 11111 gecos: |- User1 gecos On multiple lines -dir: /home/user1 +home: /home/user1 shell: /bin/bash -lastpwdchange: -1 -maxpwdage: -1 -pwdwarnperiod: -1 -pwdinactivity: -1 -minpwdage: -1 -expirationdate: -1 +broker_id: broker-id diff --git a/internal/users/db/testdata/golden/TestUserByName/Get_existing_user b/internal/users/db/testdata/golden/TestUserByName/Get_existing_user index ae9003a06..589296533 100644 --- a/internal/users/db/testdata/golden/TestUserByName/Get_existing_user +++ b/internal/users/db/testdata/golden/TestUserByName/Get_existing_user @@ -4,11 +4,6 @@ gid: 11111 gecos: |- User1 gecos On multiple lines -dir: /home/user1 +home: /home/user1 shell: /bin/bash -lastpwdchange: -1 -maxpwdage: -1 -pwdwarnperiod: -1 -pwdinactivity: -1 -minpwdage: -1 -expirationdate: -1 +broker_id: broker-id diff --git a/internal/users/db/testdata/multiple_users_and_groups.db.yaml b/internal/users/db/testdata/multiple_users_and_groups.db.yaml index 7c3c8d2b8..16246e989 100644 --- a/internal/users/db/testdata/multiple_users_and_groups.db.yaml +++ b/internal/users/db/testdata/multiple_users_and_groups.db.yaml @@ -1,43 +1,67 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - "22222": '{"Name":"group2","GID":22222,"UGID":"56781234"}' - "33333": '{"Name":"group3","GID":33333,"UGID":"34567812"}' - "44444": '{"Name":"group4","GID":44444,"UGID":"45678123"}' - "99999": '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' -GroupByName: - commongroup: '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' - group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' - group2: '{"Name":"group2","GID":22222,"UGID":"56781234"}' - group3: '{"Name":"group3","GID":33333,"UGID":"34567812"}' - group4: '{"Name":"group4","GID":44444,"UGID":"45678123"}' -GroupByUGID: - "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - "56781234": '{"Name":"group2","GID":22222,"UGID":"56781234"}' - "34567812": '{"Name":"group3","GID":33333,"UGID":"34567812"}' - "45678123": '{"Name":"group4","GID":44444,"UGID":"45678123"}' - "87654321": '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' - "22222": '{"GID":22222,"UIDs":[2222]}' - "33333": '{"GID":33333,"UIDs":[3333]}' - "44444": '{"GID":33333,"UIDs":[4444]}' - "99999": '{"GID":99999,"UIDs":[1111,2222,3333,4444]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' - "2222": '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - "3333": '{"Name":"user3","UID":3333,"GID":33333,"Gecos":"User3","Dir":"/home/user3","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' - "4444": '{"Name":"userwithoutbroker","UID":4444,"GID":44444,"Gecos":"userwithoutbroker","Dir":"/home/userwithoutbroker","Shell":"/bin/sh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2004-04-04T04:04:04Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' - user2: '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - user3: '{"Name":"user3","UID":3333,"GID":33333,"Gecos":"User3","Dir":"/home/user3","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' - userwithoutbroker: '{"Name":"userwithoutbroker","UID":4444,"GID":44444,"Gecos":"userwithoutbroker","Dir":"/home/userwithoutbroker","Shell":"/bin/sh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2004-04-04T04:04:04Z"}' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11111,99999]}' - "2222": '{"UID":2222,"GIDs":[22222,99999]}' - "3333": '{"UID":3333,"GIDs":[33333,99999]}' - "4444": '{"UID":4444,"GIDs":[44444,99999]}' -UserToBroker: - "1111": '"broker-id"' - "2222": '"broker-id"' - "3333": '"broker-id"' +users: + - name: user1 + uid: 1111 + gid: 11111 + gecos: |- + User1 gecos + On multiple lines + home: /home/user1 + shell: /bin/bash + broker_id: broker-id + last_login: 2001-01-01T01:01:01Z + - name: user2 + uid: 2222 + gid: 22222 + gecos: User2 + home: /home/user2 + shell: /bin/dash + broker_id: broker-id + last_login: 2002-02-02T02:02:02Z + - name: user3 + uid: 3333 + gid: 33333 + gecos: User3 + home: /home/user3 + shell: /bin/zsh + broker_id: broker-id + last_login: 2003-03-03T03:03:03Z + - name: userwithoutbroker + uid: 4444 + gid: 44444 + gecos: userwithoutbroker + home: /home/userwithoutbroker + shell: /bin/sh + last_login: 2004-04-04T04:04:04Z +groups: + - name: group1 + gid: 11111 + ugid: "12345678" + - name: group2 + gid: 22222 + ugid: "56781234" + - name: group3 + gid: 33333 + ugid: "34567812" + - name: group4 + gid: 44444 + ugid: "45678123" + - name: commongroup + gid: 99999 + ugid: "87654321" +users_to_groups: + - uid: 1111 + gid: 11111 + - uid: 1111 + gid: 99999 + - uid: 2222 + gid: 22222 + - uid: 2222 + gid: 99999 + - uid: 3333 + gid: 33333 + - uid: 3333 + gid: 99999 + - uid: 4444 + gid: 44444 + - uid: 4444 + gid: 99999 diff --git a/internal/users/db/testdata/one_user_and_group.db.yaml b/internal/users/db/testdata/one_user_and_group.db.yaml index e7d0b593d..309dd2ba0 100644 --- a/internal/users/db/testdata/one_user_and_group.db.yaml +++ b/internal/users/db/testdata/one_user_and_group.db.yaml @@ -1,16 +1,18 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupByName: - group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupByUGID: - "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11111]}' -UserToBroker: - "1111": '"broker-id"' +users: + - name: user1 + uid: 1111 + gid: 11111 + gecos: |- + User1 gecos + On multiple lines + home: /home/user1 + shell: /bin/bash + broker_id: broker-id + last_login: 2001-01-01T01:01:01Z +groups: + - name: group1 + gid: 11111 + ugid: "12345678" +users_to_groups: + - uid: 1111 + gid: 11111 diff --git a/internal/users/testdata/db/group-with-empty-UGID.db.yaml b/internal/users/testdata/db/group-with-empty-UGID.db.yaml index 50f128362..50e6dc91d 100644 --- a/internal/users/testdata/db/group-with-empty-UGID.db.yaml +++ b/internal/users/testdata/db/group-with-empty-UGID.db.yaml @@ -1,16 +1,18 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111}' -GroupByName: - group1: '{"Name":"group1","GID":11111}' -GroupByUGID: - "12345678": '{"Name":"group1","GID":11111}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11111]}' -UserToBroker: - "1111": '"broker-id"' +users: + - name: user1 + uid: 1111 + gid: 11111 + gecos: |- + User1 gecos + On multiple lines + home: /home/user1 + shell: /bin/bash + broker_id: broker-id + last_login: 2001-01-01T01:01:01Z +groups: + - name: group1 + gid: 11111 + ugid: "" +users_to_groups: + - uid: 1111 + gid: 11111 diff --git a/internal/users/testdata/db/multiple_users_and_groups.db.yaml b/internal/users/testdata/db/multiple_users_and_groups.db.yaml index 7c3c8d2b8..16246e989 100644 --- a/internal/users/testdata/db/multiple_users_and_groups.db.yaml +++ b/internal/users/testdata/db/multiple_users_and_groups.db.yaml @@ -1,43 +1,67 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - "22222": '{"Name":"group2","GID":22222,"UGID":"56781234"}' - "33333": '{"Name":"group3","GID":33333,"UGID":"34567812"}' - "44444": '{"Name":"group4","GID":44444,"UGID":"45678123"}' - "99999": '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' -GroupByName: - commongroup: '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' - group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' - group2: '{"Name":"group2","GID":22222,"UGID":"56781234"}' - group3: '{"Name":"group3","GID":33333,"UGID":"34567812"}' - group4: '{"Name":"group4","GID":44444,"UGID":"45678123"}' -GroupByUGID: - "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - "56781234": '{"Name":"group2","GID":22222,"UGID":"56781234"}' - "34567812": '{"Name":"group3","GID":33333,"UGID":"34567812"}' - "45678123": '{"Name":"group4","GID":44444,"UGID":"45678123"}' - "87654321": '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' - "22222": '{"GID":22222,"UIDs":[2222]}' - "33333": '{"GID":33333,"UIDs":[3333]}' - "44444": '{"GID":33333,"UIDs":[4444]}' - "99999": '{"GID":99999,"UIDs":[1111,2222,3333,4444]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' - "2222": '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - "3333": '{"Name":"user3","UID":3333,"GID":33333,"Gecos":"User3","Dir":"/home/user3","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' - "4444": '{"Name":"userwithoutbroker","UID":4444,"GID":44444,"Gecos":"userwithoutbroker","Dir":"/home/userwithoutbroker","Shell":"/bin/sh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2004-04-04T04:04:04Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' - user2: '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - user3: '{"Name":"user3","UID":3333,"GID":33333,"Gecos":"User3","Dir":"/home/user3","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' - userwithoutbroker: '{"Name":"userwithoutbroker","UID":4444,"GID":44444,"Gecos":"userwithoutbroker","Dir":"/home/userwithoutbroker","Shell":"/bin/sh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2004-04-04T04:04:04Z"}' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11111,99999]}' - "2222": '{"UID":2222,"GIDs":[22222,99999]}' - "3333": '{"UID":3333,"GIDs":[33333,99999]}' - "4444": '{"UID":4444,"GIDs":[44444,99999]}' -UserToBroker: - "1111": '"broker-id"' - "2222": '"broker-id"' - "3333": '"broker-id"' +users: + - name: user1 + uid: 1111 + gid: 11111 + gecos: |- + User1 gecos + On multiple lines + home: /home/user1 + shell: /bin/bash + broker_id: broker-id + last_login: 2001-01-01T01:01:01Z + - name: user2 + uid: 2222 + gid: 22222 + gecos: User2 + home: /home/user2 + shell: /bin/dash + broker_id: broker-id + last_login: 2002-02-02T02:02:02Z + - name: user3 + uid: 3333 + gid: 33333 + gecos: User3 + home: /home/user3 + shell: /bin/zsh + broker_id: broker-id + last_login: 2003-03-03T03:03:03Z + - name: userwithoutbroker + uid: 4444 + gid: 44444 + gecos: userwithoutbroker + home: /home/userwithoutbroker + shell: /bin/sh + last_login: 2004-04-04T04:04:04Z +groups: + - name: group1 + gid: 11111 + ugid: "12345678" + - name: group2 + gid: 22222 + ugid: "56781234" + - name: group3 + gid: 33333 + ugid: "34567812" + - name: group4 + gid: 44444 + ugid: "45678123" + - name: commongroup + gid: 99999 + ugid: "87654321" +users_to_groups: + - uid: 1111 + gid: 11111 + - uid: 1111 + gid: 99999 + - uid: 2222 + gid: 22222 + - uid: 2222 + gid: 99999 + - uid: 3333 + gid: 33333 + - uid: 3333 + gid: 99999 + - uid: 4444 + gid: 44444 + - uid: 4444 + gid: 99999 diff --git a/internal/users/testdata/db/one_user_and_group.db.yaml b/internal/users/testdata/db/one_user_and_group.db.yaml index e7d0b593d..309dd2ba0 100644 --- a/internal/users/testdata/db/one_user_and_group.db.yaml +++ b/internal/users/testdata/db/one_user_and_group.db.yaml @@ -1,16 +1,18 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupByName: - group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupByUGID: - "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11111]}' -UserToBroker: - "1111": '"broker-id"' +users: + - name: user1 + uid: 1111 + gid: 11111 + gecos: |- + User1 gecos + On multiple lines + home: /home/user1 + shell: /bin/bash + broker_id: broker-id + last_login: 2001-01-01T01:01:01Z +groups: + - name: group1 + gid: 11111 + ugid: "12345678" +users_to_groups: + - uid: 1111 + gid: 11111 diff --git a/internal/users/testdata/golden/TestNewManager/Successfully_create_manager_with_custom_config b/internal/users/testdata/golden/TestNewManager/Successfully_create_manager_with_custom_config index 0e7bf1a06..16246e989 100644 --- a/internal/users/testdata/golden/TestNewManager/Successfully_create_manager_with_custom_config +++ b/internal/users/testdata/golden/TestNewManager/Successfully_create_manager_with_custom_config @@ -1,44 +1,67 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - "22222": '{"Name":"group2","GID":22222,"UGID":"56781234"}' - "33333": '{"Name":"group3","GID":33333,"UGID":"34567812"}' - "44444": '{"Name":"group4","GID":44444,"UGID":"45678123"}' - "99999": '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' -GroupByName: - commongroup: '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' - group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' - group2: '{"Name":"group2","GID":22222,"UGID":"56781234"}' - group3: '{"Name":"group3","GID":33333,"UGID":"34567812"}' - group4: '{"Name":"group4","GID":44444,"UGID":"45678123"}' -GroupByUGID: - "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - "34567812": '{"Name":"group3","GID":33333,"UGID":"34567812"}' - "45678123": '{"Name":"group4","GID":44444,"UGID":"45678123"}' - "56781234": '{"Name":"group2","GID":22222,"UGID":"56781234"}' - "87654321": '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' - "22222": '{"GID":22222,"UIDs":[2222]}' - "33333": '{"GID":33333,"UIDs":[3333]}' - "44444": '{"GID":33333,"UIDs":[4444]}' - "99999": '{"GID":99999,"UIDs":[1111,2222,3333,4444]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' - "2222": '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - "3333": '{"Name":"user3","UID":3333,"GID":33333,"Gecos":"User3","Dir":"/home/user3","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' - "4444": '{"Name":"userwithoutbroker","UID":4444,"GID":44444,"Gecos":"userwithoutbroker","Dir":"/home/userwithoutbroker","Shell":"/bin/sh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2004-04-04T04:04:04Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' - user2: '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - user3: '{"Name":"user3","UID":3333,"GID":33333,"Gecos":"User3","Dir":"/home/user3","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' - userwithoutbroker: '{"Name":"userwithoutbroker","UID":4444,"GID":44444,"Gecos":"userwithoutbroker","Dir":"/home/userwithoutbroker","Shell":"/bin/sh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2004-04-04T04:04:04Z"}' -UserToBroker: - "1111": '"broker-id"' - "2222": '"broker-id"' - "3333": '"broker-id"' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11111,99999]}' - "2222": '{"UID":2222,"GIDs":[22222,99999]}' - "3333": '{"UID":3333,"GIDs":[33333,99999]}' - "4444": '{"UID":4444,"GIDs":[44444,99999]}' -UserToLocalGroups: {} +users: + - name: user1 + uid: 1111 + gid: 11111 + gecos: |- + User1 gecos + On multiple lines + home: /home/user1 + shell: /bin/bash + broker_id: broker-id + last_login: 2001-01-01T01:01:01Z + - name: user2 + uid: 2222 + gid: 22222 + gecos: User2 + home: /home/user2 + shell: /bin/dash + broker_id: broker-id + last_login: 2002-02-02T02:02:02Z + - name: user3 + uid: 3333 + gid: 33333 + gecos: User3 + home: /home/user3 + shell: /bin/zsh + broker_id: broker-id + last_login: 2003-03-03T03:03:03Z + - name: userwithoutbroker + uid: 4444 + gid: 44444 + gecos: userwithoutbroker + home: /home/userwithoutbroker + shell: /bin/sh + last_login: 2004-04-04T04:04:04Z +groups: + - name: group1 + gid: 11111 + ugid: "12345678" + - name: group2 + gid: 22222 + ugid: "56781234" + - name: group3 + gid: 33333 + ugid: "34567812" + - name: group4 + gid: 44444 + ugid: "45678123" + - name: commongroup + gid: 99999 + ugid: "87654321" +users_to_groups: + - uid: 1111 + gid: 11111 + - uid: 1111 + gid: 99999 + - uid: 2222 + gid: 22222 + - uid: 2222 + gid: 99999 + - uid: 3333 + gid: 33333 + - uid: 3333 + gid: 99999 + - uid: 4444 + gid: 44444 + - uid: 4444 + gid: 99999 diff --git a/internal/users/testdata/golden/TestNewManager/Successfully_create_manager_with_default_config b/internal/users/testdata/golden/TestNewManager/Successfully_create_manager_with_default_config index 0e7bf1a06..16246e989 100644 --- a/internal/users/testdata/golden/TestNewManager/Successfully_create_manager_with_default_config +++ b/internal/users/testdata/golden/TestNewManager/Successfully_create_manager_with_default_config @@ -1,44 +1,67 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - "22222": '{"Name":"group2","GID":22222,"UGID":"56781234"}' - "33333": '{"Name":"group3","GID":33333,"UGID":"34567812"}' - "44444": '{"Name":"group4","GID":44444,"UGID":"45678123"}' - "99999": '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' -GroupByName: - commongroup: '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' - group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' - group2: '{"Name":"group2","GID":22222,"UGID":"56781234"}' - group3: '{"Name":"group3","GID":33333,"UGID":"34567812"}' - group4: '{"Name":"group4","GID":44444,"UGID":"45678123"}' -GroupByUGID: - "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - "34567812": '{"Name":"group3","GID":33333,"UGID":"34567812"}' - "45678123": '{"Name":"group4","GID":44444,"UGID":"45678123"}' - "56781234": '{"Name":"group2","GID":22222,"UGID":"56781234"}' - "87654321": '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' - "22222": '{"GID":22222,"UIDs":[2222]}' - "33333": '{"GID":33333,"UIDs":[3333]}' - "44444": '{"GID":33333,"UIDs":[4444]}' - "99999": '{"GID":99999,"UIDs":[1111,2222,3333,4444]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' - "2222": '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - "3333": '{"Name":"user3","UID":3333,"GID":33333,"Gecos":"User3","Dir":"/home/user3","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' - "4444": '{"Name":"userwithoutbroker","UID":4444,"GID":44444,"Gecos":"userwithoutbroker","Dir":"/home/userwithoutbroker","Shell":"/bin/sh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2004-04-04T04:04:04Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' - user2: '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - user3: '{"Name":"user3","UID":3333,"GID":33333,"Gecos":"User3","Dir":"/home/user3","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' - userwithoutbroker: '{"Name":"userwithoutbroker","UID":4444,"GID":44444,"Gecos":"userwithoutbroker","Dir":"/home/userwithoutbroker","Shell":"/bin/sh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2004-04-04T04:04:04Z"}' -UserToBroker: - "1111": '"broker-id"' - "2222": '"broker-id"' - "3333": '"broker-id"' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11111,99999]}' - "2222": '{"UID":2222,"GIDs":[22222,99999]}' - "3333": '{"UID":3333,"GIDs":[33333,99999]}' - "4444": '{"UID":4444,"GIDs":[44444,99999]}' -UserToLocalGroups: {} +users: + - name: user1 + uid: 1111 + gid: 11111 + gecos: |- + User1 gecos + On multiple lines + home: /home/user1 + shell: /bin/bash + broker_id: broker-id + last_login: 2001-01-01T01:01:01Z + - name: user2 + uid: 2222 + gid: 22222 + gecos: User2 + home: /home/user2 + shell: /bin/dash + broker_id: broker-id + last_login: 2002-02-02T02:02:02Z + - name: user3 + uid: 3333 + gid: 33333 + gecos: User3 + home: /home/user3 + shell: /bin/zsh + broker_id: broker-id + last_login: 2003-03-03T03:03:03Z + - name: userwithoutbroker + uid: 4444 + gid: 44444 + gecos: userwithoutbroker + home: /home/userwithoutbroker + shell: /bin/sh + last_login: 2004-04-04T04:04:04Z +groups: + - name: group1 + gid: 11111 + ugid: "12345678" + - name: group2 + gid: 22222 + ugid: "56781234" + - name: group3 + gid: 33333 + ugid: "34567812" + - name: group4 + gid: 44444 + ugid: "45678123" + - name: commongroup + gid: 99999 + ugid: "87654321" +users_to_groups: + - uid: 1111 + gid: 11111 + - uid: 1111 + gid: 99999 + - uid: 2222 + gid: 22222 + - uid: 2222 + gid: 99999 + - uid: 3333 + gid: 33333 + - uid: 3333 + gid: 99999 + - uid: 4444 + gid: 44444 + - uid: 4444 + gid: 99999 diff --git a/internal/users/testdata/golden/TestUpdateBrokerForUser/Successfully_update_broker_for_user b/internal/users/testdata/golden/TestUpdateBrokerForUser/Successfully_update_broker_for_user index 97fce91a9..e96c404d3 100644 --- a/internal/users/testdata/golden/TestUpdateBrokerForUser/Successfully_update_broker_for_user +++ b/internal/users/testdata/golden/TestUpdateBrokerForUser/Successfully_update_broker_for_user @@ -1,44 +1,67 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - "22222": '{"Name":"group2","GID":22222,"UGID":"56781234"}' - "33333": '{"Name":"group3","GID":33333,"UGID":"34567812"}' - "44444": '{"Name":"group4","GID":44444,"UGID":"45678123"}' - "99999": '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' -GroupByName: - commongroup: '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' - group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' - group2: '{"Name":"group2","GID":22222,"UGID":"56781234"}' - group3: '{"Name":"group3","GID":33333,"UGID":"34567812"}' - group4: '{"Name":"group4","GID":44444,"UGID":"45678123"}' -GroupByUGID: - "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - "34567812": '{"Name":"group3","GID":33333,"UGID":"34567812"}' - "45678123": '{"Name":"group4","GID":44444,"UGID":"45678123"}' - "56781234": '{"Name":"group2","GID":22222,"UGID":"56781234"}' - "87654321": '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' - "22222": '{"GID":22222,"UIDs":[2222]}' - "33333": '{"GID":33333,"UIDs":[3333]}' - "44444": '{"GID":33333,"UIDs":[4444]}' - "99999": '{"GID":99999,"UIDs":[1111,2222,3333,4444]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' - "2222": '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - "3333": '{"Name":"user3","UID":3333,"GID":33333,"Gecos":"User3","Dir":"/home/user3","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' - "4444": '{"Name":"userwithoutbroker","UID":4444,"GID":44444,"Gecos":"userwithoutbroker","Dir":"/home/userwithoutbroker","Shell":"/bin/sh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2004-04-04T04:04:04Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' - user2: '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - user3: '{"Name":"user3","UID":3333,"GID":33333,"Gecos":"User3","Dir":"/home/user3","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' - userwithoutbroker: '{"Name":"userwithoutbroker","UID":4444,"GID":44444,"Gecos":"userwithoutbroker","Dir":"/home/userwithoutbroker","Shell":"/bin/sh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2004-04-04T04:04:04Z"}' -UserToBroker: - "1111": '"ExampleBrokerID"' - "2222": '"broker-id"' - "3333": '"broker-id"' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11111,99999]}' - "2222": '{"UID":2222,"GIDs":[22222,99999]}' - "3333": '{"UID":3333,"GIDs":[33333,99999]}' - "4444": '{"UID":4444,"GIDs":[44444,99999]}' -UserToLocalGroups: {} +users: + - name: user1 + uid: 1111 + gid: 11111 + gecos: |- + User1 gecos + On multiple lines + home: /home/user1 + shell: /bin/bash + broker_id: ExampleBrokerID + last_login: 2001-01-01T01:01:01Z + - name: user2 + uid: 2222 + gid: 22222 + gecos: User2 + home: /home/user2 + shell: /bin/dash + broker_id: broker-id + last_login: 2002-02-02T02:02:02Z + - name: user3 + uid: 3333 + gid: 33333 + gecos: User3 + home: /home/user3 + shell: /bin/zsh + broker_id: broker-id + last_login: 2003-03-03T03:03:03Z + - name: userwithoutbroker + uid: 4444 + gid: 44444 + gecos: userwithoutbroker + home: /home/userwithoutbroker + shell: /bin/sh + last_login: 2004-04-04T04:04:04Z +groups: + - name: group1 + gid: 11111 + ugid: "12345678" + - name: group2 + gid: 22222 + ugid: "56781234" + - name: group3 + gid: 33333 + ugid: "34567812" + - name: group4 + gid: 44444 + ugid: "45678123" + - name: commongroup + gid: 99999 + ugid: "87654321" +users_to_groups: + - uid: 1111 + gid: 11111 + - uid: 1111 + gid: 99999 + - uid: 2222 + gid: 22222 + - uid: 2222 + gid: 99999 + - uid: 3333 + gid: 33333 + - uid: 3333 + gid: 99999 + - uid: 4444 + gid: 44444 + - uid: 4444 + gid: 99999 diff --git a/internal/users/testdata/golden/TestUpdateUser/GID_does_not_change_if_group_with_same_UGID_exists b/internal/users/testdata/golden/TestUpdateUser/GID_does_not_change_if_group_with_same_UGID_exists index a05dc75ae..7912fda7d 100644 --- a/internal/users/testdata/golden/TestUpdateUser/GID_does_not_change_if_group_with_same_UGID_exists +++ b/internal/users/testdata/golden/TestUpdateUser/GID_does_not_change_if_group_with_same_UGID_exists @@ -1,22 +1,20 @@ -GroupByID: - "11110": '{"Name":"user1","GID":11110,"UGID":"user1"}' - "11111": '{"Name":"renamed-group","GID":11111,"UGID":"12345678"}' -GroupByName: - renamed-group: '{"Name":"renamed-group","GID":11111,"UGID":"12345678"}' - user1: '{"Name":"user1","GID":11110,"UGID":"user1"}' -GroupByUGID: - "12345678": '{"Name":"renamed-group","GID":11111,"UGID":"12345678"}' - user1: '{"Name":"user1","GID":11110,"UGID":"user1"}' -GroupToUsers: - "11110": '{"GID":11110,"UIDs":[1111]}' - "11111": '{"GID":11111,"UIDs":[1111]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11110,"Gecos":"gecos for user1","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11110,"Gecos":"gecos for user1","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserToBroker: - "1111": '"broker-id"' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11110,11111]}' -UserToLocalGroups: - "1111": "null" +users: + - name: user1 + uid: 1111 + gid: 11110 + gecos: gecos for user1 + home: /home/user1 + shell: /bin/bash + last_login: 2020-01-01T00:00:00Z +groups: + - name: user1 + gid: 11110 + ugid: user1 + - name: renamed-group + gid: 11111 + ugid: "12345678" +users_to_groups: + - uid: 1111 + gid: 11110 + - uid: 1111 + gid: 11111 diff --git a/internal/users/testdata/golden/TestUpdateUser/GID_does_not_change_if_group_with_same_name_and_empty_UGID_exists b/internal/users/testdata/golden/TestUpdateUser/GID_does_not_change_if_group_with_same_name_and_empty_UGID_exists index b0a8fc8c2..f23573681 100644 --- a/internal/users/testdata/golden/TestUpdateUser/GID_does_not_change_if_group_with_same_name_and_empty_UGID_exists +++ b/internal/users/testdata/golden/TestUpdateUser/GID_does_not_change_if_group_with_same_name_and_empty_UGID_exists @@ -1,23 +1,20 @@ -GroupByID: - "11110": '{"Name":"user1","GID":11110,"UGID":"user1"}' - "11111": '{"Name":"group1","GID":11111,"UGID":"1"}' -GroupByName: - group1: '{"Name":"group1","GID":11111,"UGID":"1"}' - user1: '{"Name":"user1","GID":11110,"UGID":"user1"}' -GroupByUGID: - "1": '{"Name":"group1","GID":11111,"UGID":"1"}' - "12345678": '{"Name":"group1","GID":11111}' - user1: '{"Name":"user1","GID":11110,"UGID":"user1"}' -GroupToUsers: - "11110": '{"GID":11110,"UIDs":[1111]}' - "11111": '{"GID":11111,"UIDs":[1111]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11110,"Gecos":"gecos for user1","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11110,"Gecos":"gecos for user1","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserToBroker: - "1111": '"broker-id"' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11110,11111]}' -UserToLocalGroups: - "1111": "null" +users: + - name: user1 + uid: 1111 + gid: 11110 + gecos: gecos for user1 + home: /home/user1 + shell: /bin/bash + last_login: 2020-01-01T00:00:00Z +groups: + - name: user1 + gid: 11110 + ugid: user1 + - name: group1 + gid: 11111 + ugid: "1" +users_to_groups: + - uid: 1111 + gid: 11110 + - uid: 1111 + gid: 11111 diff --git a/internal/users/testdata/golden/TestUpdateUser/Removing_last_user_from_a_group_keeps_the_group_record b/internal/users/testdata/golden/TestUpdateUser/Removing_last_user_from_a_group_keeps_the_group_record index 009bfd6a9..952e97e4d 100644 --- a/internal/users/testdata/golden/TestUpdateUser/Removing_last_user_from_a_group_keeps_the_group_record +++ b/internal/users/testdata/golden/TestUpdateUser/Removing_last_user_from_a_group_keeps_the_group_record @@ -1,22 +1,18 @@ -GroupByID: - "11110": '{"Name":"user1","GID":11110,"UGID":"user1"}' - "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupByName: - group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' - user1: '{"Name":"user1","GID":11110,"UGID":"user1"}' -GroupByUGID: - "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - user1: '{"Name":"user1","GID":11110,"UGID":"user1"}' -GroupToUsers: - "11110": '{"GID":11110,"UIDs":[1111]}' - "11111": '{"GID":11111,"UIDs":[]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11110,"Gecos":"gecos for user1","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11110,"Gecos":"gecos for user1","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserToBroker: - "1111": '"broker-id"' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11110]}' -UserToLocalGroups: - "1111": "null" +users: + - name: user1 + uid: 1111 + gid: 11110 + gecos: gecos for user1 + home: /home/user1 + shell: /bin/bash + last_login: 2020-01-01T00:00:00Z +groups: + - name: user1 + gid: 11110 + ugid: user1 + - name: group1 + gid: 11111 + ugid: "12345678" +users_to_groups: + - uid: 1111 + gid: 11110 diff --git a/internal/users/testdata/golden/TestUpdateUser/Successfully_update_user b/internal/users/testdata/golden/TestUpdateUser/Successfully_update_user index 6563fe793..f23573681 100644 --- a/internal/users/testdata/golden/TestUpdateUser/Successfully_update_user +++ b/internal/users/testdata/golden/TestUpdateUser/Successfully_update_user @@ -1,21 +1,20 @@ -GroupByID: - "11110": '{"Name":"user1","GID":11110,"UGID":"user1"}' - "11111": '{"Name":"group1","GID":11111,"UGID":"1"}' -GroupByName: - group1: '{"Name":"group1","GID":11111,"UGID":"1"}' - user1: '{"Name":"user1","GID":11110,"UGID":"user1"}' -GroupByUGID: - "1": '{"Name":"group1","GID":11111,"UGID":"1"}' - user1: '{"Name":"user1","GID":11110,"UGID":"user1"}' -GroupToUsers: - "11110": '{"GID":11110,"UIDs":[1111]}' - "11111": '{"GID":11111,"UIDs":[1111]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11110,"Gecos":"gecos for user1","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11110,"Gecos":"gecos for user1","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserToBroker: {} -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11110,11111]}' -UserToLocalGroups: - "1111": "null" +users: + - name: user1 + uid: 1111 + gid: 11110 + gecos: gecos for user1 + home: /home/user1 + shell: /bin/bash + last_login: 2020-01-01T00:00:00Z +groups: + - name: user1 + gid: 11110 + ugid: user1 + - name: group1 + gid: 11111 + ugid: "1" +users_to_groups: + - uid: 1111 + gid: 11110 + - uid: 1111 + gid: 11111 diff --git a/internal/users/testdata/golden/TestUpdateUser/Successfully_update_user_updating_local_groups b/internal/users/testdata/golden/TestUpdateUser/Successfully_update_user_updating_local_groups index b1cd7d236..f23573681 100644 --- a/internal/users/testdata/golden/TestUpdateUser/Successfully_update_user_updating_local_groups +++ b/internal/users/testdata/golden/TestUpdateUser/Successfully_update_user_updating_local_groups @@ -1,21 +1,20 @@ -GroupByID: - "11110": '{"Name":"user1","GID":11110,"UGID":"user1"}' - "11111": '{"Name":"group1","GID":11111,"UGID":"1"}' -GroupByName: - group1: '{"Name":"group1","GID":11111,"UGID":"1"}' - user1: '{"Name":"user1","GID":11110,"UGID":"user1"}' -GroupByUGID: - "1": '{"Name":"group1","GID":11111,"UGID":"1"}' - user1: '{"Name":"user1","GID":11110,"UGID":"user1"}' -GroupToUsers: - "11110": '{"GID":11110,"UIDs":[1111]}' - "11111": '{"GID":11111,"UIDs":[1111]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11110,"Gecos":"gecos for user1","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11110,"Gecos":"gecos for user1","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserToBroker: {} -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11110,11111]}' -UserToLocalGroups: - "1111": '["localgroup1"]' +users: + - name: user1 + uid: 1111 + gid: 11110 + gecos: gecos for user1 + home: /home/user1 + shell: /bin/bash + last_login: 2020-01-01T00:00:00Z +groups: + - name: user1 + gid: 11110 + ugid: user1 + - name: group1 + gid: 11111 + ugid: "1" +users_to_groups: + - uid: 1111 + gid: 11110 + - uid: 1111 + gid: 11111 diff --git a/internal/users/testdata/golden/TestUpdateUser/UID_does_not_change_if_user_already_exists b/internal/users/testdata/golden/TestUpdateUser/UID_does_not_change_if_user_already_exists index 009bfd6a9..952e97e4d 100644 --- a/internal/users/testdata/golden/TestUpdateUser/UID_does_not_change_if_user_already_exists +++ b/internal/users/testdata/golden/TestUpdateUser/UID_does_not_change_if_user_already_exists @@ -1,22 +1,18 @@ -GroupByID: - "11110": '{"Name":"user1","GID":11110,"UGID":"user1"}' - "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupByName: - group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' - user1: '{"Name":"user1","GID":11110,"UGID":"user1"}' -GroupByUGID: - "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - user1: '{"Name":"user1","GID":11110,"UGID":"user1"}' -GroupToUsers: - "11110": '{"GID":11110,"UIDs":[1111]}' - "11111": '{"GID":11111,"UIDs":[]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11110,"Gecos":"gecos for user1","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11110,"Gecos":"gecos for user1","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2020-01-01T00:00:00Z"}' -UserToBroker: - "1111": '"broker-id"' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11110]}' -UserToLocalGroups: - "1111": "null" +users: + - name: user1 + uid: 1111 + gid: 11110 + gecos: gecos for user1 + home: /home/user1 + shell: /bin/bash + last_login: 2020-01-01T00:00:00Z +groups: + - name: user1 + gid: 11110 + ugid: user1 + - name: group1 + gid: 11111 + ugid: "12345678" +users_to_groups: + - uid: 1111 + gid: 11110 diff --git a/nss/integration-tests/testdata/db/multiple_users_and_groups.db.yaml b/nss/integration-tests/testdata/db/multiple_users_and_groups.db.yaml index 7c3c8d2b8..16246e989 100644 --- a/nss/integration-tests/testdata/db/multiple_users_and_groups.db.yaml +++ b/nss/integration-tests/testdata/db/multiple_users_and_groups.db.yaml @@ -1,43 +1,67 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - "22222": '{"Name":"group2","GID":22222,"UGID":"56781234"}' - "33333": '{"Name":"group3","GID":33333,"UGID":"34567812"}' - "44444": '{"Name":"group4","GID":44444,"UGID":"45678123"}' - "99999": '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' -GroupByName: - commongroup: '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' - group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' - group2: '{"Name":"group2","GID":22222,"UGID":"56781234"}' - group3: '{"Name":"group3","GID":33333,"UGID":"34567812"}' - group4: '{"Name":"group4","GID":44444,"UGID":"45678123"}' -GroupByUGID: - "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' - "56781234": '{"Name":"group2","GID":22222,"UGID":"56781234"}' - "34567812": '{"Name":"group3","GID":33333,"UGID":"34567812"}' - "45678123": '{"Name":"group4","GID":44444,"UGID":"45678123"}' - "87654321": '{"Name":"commongroup","GID":99999,"UGID":"87654321"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' - "22222": '{"GID":22222,"UIDs":[2222]}' - "33333": '{"GID":33333,"UIDs":[3333]}' - "44444": '{"GID":33333,"UIDs":[4444]}' - "99999": '{"GID":99999,"UIDs":[1111,2222,3333,4444]}' -UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' - "2222": '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - "3333": '{"Name":"user3","UID":3333,"GID":33333,"Gecos":"User3","Dir":"/home/user3","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' - "4444": '{"Name":"userwithoutbroker","UID":4444,"GID":44444,"Gecos":"userwithoutbroker","Dir":"/home/userwithoutbroker","Shell":"/bin/sh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2004-04-04T04:04:04Z"}' -UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' - user2: '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2002-02-02T02:02:02Z"}' - user3: '{"Name":"user3","UID":3333,"GID":33333,"Gecos":"User3","Dir":"/home/user3","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2003-03-03T03:03:03Z"}' - userwithoutbroker: '{"Name":"userwithoutbroker","UID":4444,"GID":44444,"Gecos":"userwithoutbroker","Dir":"/home/userwithoutbroker","Shell":"/bin/sh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2004-04-04T04:04:04Z"}' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11111,99999]}' - "2222": '{"UID":2222,"GIDs":[22222,99999]}' - "3333": '{"UID":3333,"GIDs":[33333,99999]}' - "4444": '{"UID":4444,"GIDs":[44444,99999]}' -UserToBroker: - "1111": '"broker-id"' - "2222": '"broker-id"' - "3333": '"broker-id"' +users: + - name: user1 + uid: 1111 + gid: 11111 + gecos: |- + User1 gecos + On multiple lines + home: /home/user1 + shell: /bin/bash + broker_id: broker-id + last_login: 2001-01-01T01:01:01Z + - name: user2 + uid: 2222 + gid: 22222 + gecos: User2 + home: /home/user2 + shell: /bin/dash + broker_id: broker-id + last_login: 2002-02-02T02:02:02Z + - name: user3 + uid: 3333 + gid: 33333 + gecos: User3 + home: /home/user3 + shell: /bin/zsh + broker_id: broker-id + last_login: 2003-03-03T03:03:03Z + - name: userwithoutbroker + uid: 4444 + gid: 44444 + gecos: userwithoutbroker + home: /home/userwithoutbroker + shell: /bin/sh + last_login: 2004-04-04T04:04:04Z +groups: + - name: group1 + gid: 11111 + ugid: "12345678" + - name: group2 + gid: 22222 + ugid: "56781234" + - name: group3 + gid: 33333 + ugid: "34567812" + - name: group4 + gid: 44444 + ugid: "45678123" + - name: commongroup + gid: 99999 + ugid: "87654321" +users_to_groups: + - uid: 1111 + gid: 11111 + - uid: 1111 + gid: 99999 + - uid: 2222 + gid: 22222 + - uid: 2222 + gid: 99999 + - uid: 3333 + gid: 33333 + - uid: 3333 + gid: 99999 + - uid: 4444 + gid: 44444 + - uid: 4444 + gid: 99999 diff --git a/nss/integration-tests/testdata/db/pam_unix_non_existent.db.yaml b/nss/integration-tests/testdata/db/pam_unix_non_existent.db.yaml index d01e3c5c3..2dc8f88e2 100644 --- a/nss/integration-tests/testdata/db/pam_unix_non_existent.db.yaml +++ b/nss/integration-tests/testdata/db/pam_unix_non_existent.db.yaml @@ -1,16 +1,18 @@ -GroupByID: - "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupByName: - group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupByUGID: - "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' -GroupToUsers: - "11111": '{"GID":11111,"UIDs":[1111]}' -UserByID: - "1111": '{"Name":"pam_unix_non_existent","UID":1111,"GID":11111,"Gecos":"pam_unix_non_existent gecos\nOn multiple lines","Dir":"/home/pam_unix_non_existent","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' -UserByName: - pam_unix_non_existent: '{"Name":"pam_unix_non_existent","UID":1111,"GID":11111,"Gecos":"pam_unix_non_existent gecos\nOn multiple lines","Dir":"/home/pam_unix_non_existent","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2001-01-01T01:01:01Z"}' -UserToGroups: - "1111": '{"UID":1111,"GIDs":[11111]}' -UserToBroker: - "1111": '"broker-id"' +users: + - name: pam_unix_non_existent + uid: 1111 + gid: 11111 + gecos: |- + pam_unix_non_existent gecos + On multiple lines + home: /home/pam_unix_non_existent + shell: /bin/bash + broker_id: broker-id + last_login: 2001-01-01T01:01:01Z +groups: + - name: group1 + gid: 11111 + ugid: "12345678" +users_to_groups: + - uid: 1111 + gid: 11111 diff --git a/nss/integration-tests/testdata/golden/TestIntegration/Get_all_entries_from_group b/nss/integration-tests/testdata/golden/TestIntegration/Get_all_entries_from_group index 9c872c190..166a83042 100644 --- a/nss/integration-tests/testdata/golden/TestIntegration/Get_all_entries_from_group +++ b/nss/integration-tests/testdata/golden/TestIntegration/Get_all_entries_from_group @@ -1,4 +1,5 @@ group1::11111:user1 group2::22222:user2 group3::33333:user3 -commongroup::99999:user2,user3 +group4::44444:userwithoutbroker +commongroup::99999:user1,user2,user3,userwithoutbroker diff --git a/nss/integration-tests/testdata/golden/TestIntegration/Get_all_entries_from_passwd b/nss/integration-tests/testdata/golden/TestIntegration/Get_all_entries_from_passwd index a7998a555..9a15000ce 100644 --- a/nss/integration-tests/testdata/golden/TestIntegration/Get_all_entries_from_passwd +++ b/nss/integration-tests/testdata/golden/TestIntegration/Get_all_entries_from_passwd @@ -1,3 +1,4 @@ user1:x:1111:11111:User1 gecos On multiple lines:/home/user1:/bin/bash user2:x:2222:22222:User2:/home/user2:/bin/dash user3:x:3333:33333:User3:/home/user3:/bin/zsh +userwithoutbroker:x:4444:44444:userwithoutbroker:/home/userwithoutbroker:/bin/sh diff --git a/nss/integration-tests/testdata/golden/TestIntegration/Get_all_entries_from_shadow_if_considered_root b/nss/integration-tests/testdata/golden/TestIntegration/Get_all_entries_from_shadow_if_considered_root index ad70636a7..895b434a3 100644 --- a/nss/integration-tests/testdata/golden/TestIntegration/Get_all_entries_from_shadow_if_considered_root +++ b/nss/integration-tests/testdata/golden/TestIntegration/Get_all_entries_from_shadow_if_considered_root @@ -1,3 +1,4 @@ user1:x::::::: user2:x::::::: user3:x::::::: +userwithoutbroker:x:::::::