Commit 9fe431d
committed
azrepos: add login/logout/list for Microsoft accounts and rename list to list-bindings
Split the verb surface into two clusters:
- `login` / `logout` / `list` now operate on the MSAL account
cache: they add an account, remove one, and enumerate what is
currently cached. They do not touch the binding manager.
- `bind` / `unbind` / `list-bindings` continue to manage which
account a particular Azure DevOps organization should use.
`list-bindings` is what `list` used to be (pure rename — the
binding view, argument surface, and output format are
unchanged).
The names were previously overloaded: the old `list` showed
bindings, there was no equivalent of `gh auth status` for "which
identities does GCM actually have credentials for", and signing in
or out was an implicit side effect of bind/unbind. Splitting the
clusters makes the two layers explicit and matches the vocabulary
of comparable tools (`az login`, `gh auth login`).
- `azure-repos login [--tenant <id|domain>]`
Runs an interactive Microsoft sign-in. With no flag, signs in
against the wildcard `organizations` authority so the user can
pick any work/school account; `--tenant` constrains to a
specific Microsoft Entra tenant. The flag exists primarily to
pre-stage a guest-account record: signing in against the home
tenant for a UPN that's also a guest in another tenant only
populates the cache with the home-tenant account, so for the
guest tenant you have to sign in explicitly against that
tenant's authority.
- `azure-repos logout (<account> | --all)`
Removes one account (matched by UPN or HomeAccountId) or every
cached account from MSAL. UPN matches are case-insensitive;
ambiguous matches print the candidates so the user can specify
by HomeAccountId. No interactive picker yet — `<account>` is
required unless `--all` is passed.
- `azure-repos list`
Prints each cached account on its own line followed by an
indented HomeAccountId line, sorted by UPN. The
HomeAccountId line exists so users can copy it into
`logout <account>` and `bind` when UPN alone is ambiguous
(typically guest accounts in multiple tenants).
The rename of `list` to `list-bindings` is a deliberate breaking
change — vnext is still pre-release and there is no separate
deprecation step planned. The follow-on commit reshapes
`bind`/`unbind` themselves.
Assisted-by: Claude Opus 4.71 parent 3849131 commit 9fe431d
1 file changed
Lines changed: 156 additions & 7 deletions
File tree
Lines changed: 156 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
828 | 828 | | |
829 | 829 | | |
830 | 830 | | |
831 | | - | |
| 831 | + | |
832 | 832 | | |
833 | | - | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
834 | 861 | | |
835 | 862 | | |
836 | 863 | | |
| |||
840 | 867 | | |
841 | 868 | | |
842 | 869 | | |
843 | | - | |
844 | | - | |
845 | | - | |
846 | | - | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
847 | 874 | | |
848 | 875 | | |
849 | 876 | | |
| |||
875 | 902 | | |
876 | 903 | | |
877 | 904 | | |
| 905 | + | |
| 906 | + | |
878 | 907 | | |
| 908 | + | |
879 | 909 | | |
880 | 910 | | |
881 | 911 | | |
| |||
888 | 918 | | |
889 | 919 | | |
890 | 920 | | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
891 | 1040 | | |
892 | 1041 | | |
893 | 1042 | | |
894 | 1043 | | |
895 | 1044 | | |
896 | 1045 | | |
897 | 1046 | | |
898 | | - | |
| 1047 | + | |
899 | 1048 | | |
900 | 1049 | | |
901 | 1050 | | |
| |||
0 commit comments