Commit ba1c540
committed
test(auth): Assert JWT headers and claims (alg, typ, iat, exp)
This commit adds explicit assertions to verify that the generated JWS header correctly contains 'alg=RS256' and 'typ=JWT', and that the JWT payload contains the 'iat' and 'exp' claims with exactly a 3600-second (1-hour) expiration offset.
This brings the Java library's test suite into alignment with the expected auth specification. Other Google Cloud client libraries like Go, Node.js, and Python natively assert the presence of these standard headers and the 1-hour expiration window during their Self-Signed JWT generation tests.1 parent 79e26b8 commit ba1c540
2 files changed
Lines changed: 20 additions & 0 deletions
File tree
- google-auth-library-java/oauth2_http/javatests/com/google/auth/oauth2
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1777 | 1777 | | |
1778 | 1778 | | |
1779 | 1779 | | |
| 1780 | + | |
| 1781 | + | |
1780 | 1782 | | |
1781 | 1783 | | |
1782 | 1784 | | |
| |||
1787 | 1789 | | |
1788 | 1790 | | |
1789 | 1791 | | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
1790 | 1800 | | |
1791 | 1801 | | |
1792 | 1802 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
914 | 914 | | |
915 | 915 | | |
916 | 916 | | |
| 917 | + | |
| 918 | + | |
917 | 919 | | |
918 | 920 | | |
919 | 921 | | |
| |||
922 | 924 | | |
923 | 925 | | |
924 | 926 | | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
925 | 935 | | |
926 | 936 | | |
927 | 937 | | |
| |||
0 commit comments