diff --git a/CHANGELOG.md b/CHANGELOG.md index b3e070d..b50dd23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.1.0 (July 25, 2023) + +IMPROVEMENTS: + +- Add the artifactory/user_token/ path to support users obtaining tokens for themselves. PR: [#113](https://github.com/jfrog/artifactory-secrets-plugin/pull/113) + ## 1.0.0 (May 15, 2023) BREAKING CHANGES: diff --git a/artifactory_test.go b/artifactory_test.go index 0be0eed..cd13a84 100644 --- a/artifactory_test.go +++ b/artifactory_test.go @@ -288,25 +288,24 @@ func TestBackend_RotateAdminToken(t *testing.T) { httpmock.RegisterResponder( "DELETE", - "http://myserver.com:80/access/api/v1/tokens/fe3e6322-eb6d-468e-8445-c790113278c0", + "http://myserver.com:80/access/api/v1/tokens/84c0626b-7973-40c9-9d37-701aaf73cfb4", httpmock.NewStringResponder(200, "")) // Valid jwt Access Token - // TokenID: fe3e6322-eb6d-468e-8445-c790113278c0 + // TokenID: 84c0626b-7973-40c9-9d37-701aaf73cfb4 b, config := configuredBackend(t, map[string]interface{}{ - "access_token": `eyJ2ZXIiOiIyIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYiLCJraWQ` + - `iOiJxdkhkX3lTNWlPQTlfQ3E5Z3BVSl9WdDBzYVhsTExhdWk2SzFrb291MEJzIn0.eyJl` + - `eHQiOiJ7XCJyZXZvY2FibGVcIjpcInRydWVcIn0iLCJzdWIiOiJqZmFjQDAxZzVoZWs2a` + - `2IyOTUyMHJiejcxdjkxY3c5XC91c2Vyc1wvYWRtaW4iLCJzY3AiOiJhcHBsaWVkLXBlcm` + - `1pc3Npb25zXC9hZG1pbiIsImF1ZCI6WyJqZnJ0QCoiLCJqZmFjQCoiLCJqZmV2dEAqIiw` + - `iamZtZEAqIiwiamZjb25AKiJdLCJpc3MiOiJqZmZlQDAwMCIsImV4cCI6MTY4Njc3Nzgw` + - `MCwiaWF0IjoxNjU1MjQxODAwLCJqdGkiOiJmZTNlNjMyM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_4BpOUrqMrcDamB3mskwxcYFUMA45FRoV_JVxZsIMOyNNfDlNy01r5bA6ZcY` + + `EaseaQpU7skMCW07rUiWq4Z6U0xZEduKPlowJm9xbrBM13FEQTG4b4mW7yyOD4gqQ49wD` + + `GGXvhLVFoQ`, "url": "http://myserver.com:80/artifactory", }) diff --git a/test_utils.go b/test_utils.go index c96c682..90a291b 100644 --- a/test_utils.go +++ b/test_utils.go @@ -327,21 +327,21 @@ func NewConfiguredAcceptanceTestEnv(t *testing.T) (e *accTestEnv) { return } -const rootCert string = `MIIDHzCCAgegAwIBAgIQHC4IERZbTl67GGjV8KH04jANBgkqhkiG9w0BAQ` + - `sFADA9MTswOQYDVQQDDDJKRnJvZyBUb2tlbiBJc3N1ZXIgamZhY0AwMWc1aGVrNmtiMjk1MjB` + - `yYno3MXY5MWN3OTAgFw0yMjA2MTMxNTUxMjdaGA83MDAwMDEwMTAwMDAyN1owPTE7MDkGA1UE` + - `AwwySkZyb2cgVG9rZW4gSXNzdWVyIGpmYWNAMDFnNWhlazZrYjI5NTIwcmJ6NzF2OTFjdzkwg` + - `gEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCAArmgZSKRHWCOFKQy58EG/4soW93WoH` + - `W5KDvuDfoJKkejD9nrdmRsDbw2wyKPfqgsFz63zdOI3mBGLRRUqHxrXQc6UNxWerYuLzfb/rg` + - `gby6VzXHPGKft8eiO8w9TNMibf30MY/xFwmHWamECjZ5L9pTc8n1txizEPNW8farqQXXlli2N` + - `PymEK/G3xW1QQWfThY5lMqTjvg6DYvB5ZQMbl853S+nsW10rWHSeFpnXFo46kNN5VaoXlJunZ` + - `hPk3mm1rLIR6HLLeOPRSTIsVCqwhQbnRV84HZMVQnG9355L1EzbeEZAZjWC4r9hOmtyt4rcuq` + - `dnYuGLR3Yw2cZEILKvAgMBAAGjGTAXMBUGBFUdEQEEDTALoAkGBFUdEQECAQAwDQYJKoZIhvc` + - `NAQELBQADggEBAHblGVlZR9uyZN7sNpd7zDiVaoCJjuSFwmnEjrRqzMNxqqBixYXAb2LgeFya` + - `MqLT0WEEB5v8BQL0FlsKPob9GpzMiLfFxhQGpR5K57nRlN5Qws+XWSCydi0tBAC5mHJea8VZB` + - `j9REsFUEtgE7En2BDBRD/4DcM+d0bmyXh7GKYLoMcSEQJ+zpSJ4AwXraKKkcIwqcXMkNZhbMz` + - `l/EyhwOsDvBRb1t0VJkrS9s01buqz+gkrPwm5+0+BhLxCfT1PP5DBhs72Pt/1UPOlDLPuf/AB` + - `bZoWR2vqNvX+ia1bsAJvx56K1KkRSswhJOPCSWLnPcB/Eh6oWUY0dZQQN+5v6Hm8=` +const rootCert string = `MIIDHzCCAgegAwIBAgIQceT9KWrOSzCrxJZC8H7SljANBgkqhkiG9w0BAQ` + + `sFADA9MTswOQYDVQQDDDJKRnJvZyBUb2tlbiBJc3N1ZXIgamZhY0AwMWg0MjRodndweXR6azF` + + `henhoNms4MDdlNTAgFw0yMzA2MjcyMzEzNThaGA83MDAwMDEwMTAwMDA1OFowPTE7MDkGA1UE` + + `AwwySkZyb2cgVG9rZW4gSXNzdWVyIGpmYWNAMDFoNDI0aHZ3cHl0emsxYXp4aDZrODA3ZTUwg` + + `gEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCr6k59JmMlWScx6ib++v83L5MKecadO8` + + `awKfhzgBxPVbJHYyvBx8yl2MBaHu+5AqIxRvNUPaGIbb/reMuteLj+wKUFsAgYFdhKC6SHMxu` + + `+nbDciinY6o2g4aVZnmY1YUAi7hsiK2xl2aXVVn/ErQg/Hd00KAlJjs9x56nmAhIubZdEdYQx` + + `jdBHQweix3HwncqWwL0gDymeVcpLFh5WzNR7KSOPpWlqVVhEMkCndbzkj4wDLMAIJ4phTH71C` + + `lc7W4/KLolRP8jOIuemvdoFc3uRqrPQRU3QsGWLdJ59mwob5L7gtGfOYbQLhifFoltygvIRg8` + + `NBiByDAJiDkuTsDG4DAgMBAAGjGTAXMBUGBFUdEQEEDTALoAkGBFUdEQECAQAwDQYJKoZIhvc` + + `NAQELBQADggEBAHQJYVNvBjThimrfIvHi6mTs5nZO2GNaNQsDkFtCEeRSBLSOj3xirT50r5oH` + + `D2/0QlT7eKZ6t0tKmpl9STO58aKl2OHY2h517Q9i8ZJtYp7XMI3/bgxUfvgCet3l3LykT3alO` + + `M0IzB2h3nxeMwcROA0BU8hoTPY4aHG5k4fqGGP5grtxVW+v/LFjmGMl3ymjWML4VpvE0SCFOZ` + + `hM2/OCbLtGx5EO6gOReSUWcFvkxbkutRFQ+ZPakxSH01f5haPitNaT88GaaDXqKy/goYNh0V4` + + `EJ3F6q2rXgsKUErCO7xSgSoIMOc0XBk+zPwGjg0Nb1sva3yTHXzEG+nAF1ttDrwo=` const jwtAccessToken string = ` {