├── artifactory.v51 ├── build.go ├── api_test.go ├── archive.go ├── bintray.go ├── build_test.go ├── compliance.go ├── http_test.go ├── repos_test.go ├── archive_test.go ├── artifact_test.go ├── bintray_test.go ├── compliance_test.go ├── mimetypes_test.go ├── responses_test.go ├── search_test.go ├── security_test.go ├── storage_test.go ├── system_test.go ├── version_test.go ├── assets │ └── test │ │ ├── error.json │ │ ├── license_information.json │ │ ├── single_group.json │ │ ├── users.json │ │ ├── single_user.json │ │ ├── permissions_details.json │ │ ├── groups.json │ │ ├── permissions.json │ │ ├── virtual_repository_config.json │ │ ├── local_repository_config.json │ │ └── remote_repository_config.json ├── version.go ├── api.go ├── system.go ├── responses.go ├── security.go ├── errors.go ├── license.go ├── client_test.go ├── mimetypes.go ├── groups.go └── storage.go ├── artifactory.v54 ├── build.go ├── archive.go ├── bintray.go ├── build_test.go ├── compliance.go ├── http_test.go ├── archive_test.go ├── artifact_test.go ├── bintray_test.go ├── compliance_test.go ├── mimetypes_test.go ├── responses_test.go ├── search_test.go ├── security_test.go ├── version_test.go ├── assets │ └── test │ │ ├── error.json │ │ ├── license_information.json │ │ ├── docker_repository_tags.json │ │ ├── version_information.json │ │ ├── item_properties.json │ │ ├── docker_repositories.json │ │ ├── single_group.json │ │ ├── users.json │ │ ├── single_user.json │ │ ├── permissions_details.json │ │ ├── generic_repository_config.json │ │ ├── virtual_repository_config.json │ │ ├── groups.json │ │ ├── permissions.json │ │ ├── file_list.json │ │ ├── ha_license_information.json │ │ ├── local_repository_config.json │ │ ├── remote_repository_config.json │ │ └── system_information.txt ├── responses.go ├── security.go ├── errors.go ├── version.go ├── api.go ├── system.go ├── mimetypes.go ├── groups.go ├── permissions_targets.go └── api_test.go ├── src ├── artifactory.v401 │ ├── api.go │ ├── build.go │ ├── api_test.go │ ├── archive.go │ ├── bintray.go │ ├── build_test.go │ ├── compliance.go │ ├── http_test.go │ ├── repos_test.go │ ├── archive_test.go │ ├── artifact_test.go │ ├── bintray_test.go │ ├── compliance_test.go │ ├── mimetypes_test.go │ ├── responses_test.go │ ├── search_test.go │ ├── security_test.go │ ├── storage_test.go │ ├── system_test.go │ ├── version_test.go │ ├── version.go │ ├── assets │ │ └── test │ │ │ ├── error.json │ │ │ ├── license_information.json │ │ │ ├── single_group.json │ │ │ ├── users.json │ │ │ ├── single_user.json │ │ │ ├── permissions_details.json │ │ │ ├── groups.json │ │ │ ├── permissions.json │ │ │ ├── virtual_repository_config.json │ │ │ ├── local_repository_config.json │ │ │ └── remote_repository_config.json │ ├── responses.go │ ├── system.go │ ├── security.go │ ├── errors.go │ ├── license.go │ ├── storage.go │ ├── mimetypes.go │ ├── client_test.go │ ├── search.go │ ├── permissions_targets.go │ ├── groups.go │ └── artifact.go └── artifactory.v491 │ ├── build.go │ ├── api_test.go │ ├── archive.go │ ├── bintray.go │ ├── build_test.go │ ├── compliance.go │ ├── http_test.go │ ├── repos_test.go │ ├── archive_test.go │ ├── artifact_test.go │ ├── bintray_test.go │ ├── compliance_test.go │ ├── mimetypes_test.go │ ├── responses_test.go │ ├── search_test.go │ ├── security_test.go │ ├── storage_test.go │ ├── system_test.go │ ├── version_test.go │ ├── version.go │ ├── api.go │ ├── assets │ └── test │ │ ├── error.json │ │ ├── license_information.json │ │ ├── single_group.json │ │ ├── users.json │ │ ├── single_user.json │ │ ├── permissions_details.json │ │ ├── groups.json │ │ ├── permissions.json │ │ ├── virtual_repository_config.json │ │ ├── local_repository_config.json │ │ └── remote_repository_config.json │ ├── responses.go │ ├── system.go │ ├── security.go │ ├── errors.go │ ├── license.go │ ├── mimetypes.go │ ├── client_test.go │ ├── permissions_targets.go │ ├── storage.go │ └── groups.go ├── script ├── test ├── build ├── coverage └── lint ├── vendor ├── github.com │ ├── pmezard │ │ └── go-difflib │ │ │ ├── .travis.yml │ │ │ ├── README.md │ │ │ └── LICENSE │ ├── stretchr │ │ └── testify │ │ │ ├── http │ │ │ ├── doc.go │ │ │ ├── test_round_tripper.go │ │ │ └── test_response_writer.go │ │ │ ├── Godeps │ │ │ ├── Readme │ │ │ └── Godeps.json │ │ │ ├── require │ │ │ ├── require_forward.go.tmpl │ │ │ ├── require.go.tmpl │ │ │ ├── requirements.go │ │ │ ├── forward_requirements.go │ │ │ └── doc.go │ │ │ ├── assert │ │ │ ├── assertion_forward.go.tmpl │ │ │ ├── errors.go │ │ │ ├── forward_assertions.go │ │ │ └── doc.go │ │ │ ├── .travis.yml │ │ │ ├── package_test.go │ │ │ ├── .gitignore │ │ │ ├── suite │ │ │ └── interfaces.go │ │ │ ├── doc.go │ │ │ ├── LICENSE │ │ │ ├── LICENCE.txt │ │ │ └── mock │ │ │ └── doc.go │ ├── alecthomas │ │ ├── template │ │ │ ├── testdata │ │ │ │ ├── file1.tmpl │ │ │ │ ├── tmpl1.tmpl │ │ │ │ ├── tmpl2.tmpl │ │ │ │ └── file2.tmpl │ │ │ ├── README.md │ │ │ ├── LICENSE │ │ │ ├── examplefunc_test.go │ │ │ └── example_test.go │ │ └── units │ │ │ ├── README.md │ │ │ ├── doc.go │ │ │ ├── si.go │ │ │ ├── COPYING │ │ │ └── bytes_test.go │ ├── lusis │ │ └── outputter │ │ │ ├── script │ │ │ ├── test │ │ │ ├── coverage │ │ │ └── lint │ │ │ ├── example │ │ │ ├── color │ │ │ │ ├── color-table.png │ │ │ │ ├── README.md │ │ │ │ └── main.go │ │ │ ├── custom-output │ │ │ │ └── README.md │ │ │ ├── kingpin │ │ │ │ ├── README.md │ │ │ │ └── main.go │ │ │ ├── stdlib │ │ │ │ ├── README.md │ │ │ │ └── main.go │ │ │ └── cobra │ │ │ │ ├── README.md │ │ │ │ └── main.go │ │ │ ├── .travis.yml │ │ │ ├── outputs_test.go │ │ │ ├── tabular_output_test.go │ │ │ ├── Gopkg.toml │ │ │ ├── csv_output_test.go │ │ │ ├── errors.go │ │ │ └── output.go │ ├── olekukonko │ │ └── tablewriter │ │ │ ├── test.csv │ │ │ ├── .travis.yml │ │ │ ├── test_info.csv │ │ │ ├── csv2table │ │ │ ├── README.md │ │ │ └── csv2table.go │ │ │ ├── LICENCE.md │ │ │ ├── csv.go │ │ │ ├── wrap_test.go │ │ │ └── util.go │ ├── coreos │ │ └── go-semver │ │ │ ├── .travis.yml │ │ │ ├── example.go │ │ │ ├── README.md │ │ │ └── semver │ │ │ └── sort.go │ ├── mattn │ │ └── go-runewidth │ │ │ ├── runewidth_js.go │ │ │ ├── .travis.yml │ │ │ ├── runewidth_windows.go │ │ │ ├── README.mkd │ │ │ ├── LICENSE │ │ │ └── runewidth_posix.go │ └── davecgh │ │ └── go-spew │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── cov_report.sh │ │ ├── LICENSE │ │ └── spew │ │ ├── dumpnocgo_test.go │ │ └── bypasssafe.go └── gopkg.in │ └── alecthomas │ └── kingpin.v2 │ ├── .travis.yml │ ├── guesswidth.go │ ├── _examples │ ├── chat1 │ │ └── main.go │ ├── ping │ │ └── main.go │ ├── modular │ │ └── main.go │ └── chat2 │ │ └── main.go │ ├── guesswidth_unix.go │ ├── completions.go │ ├── envar.go │ ├── COPYING │ ├── actions.go │ ├── examples_test.go │ ├── usage_test.go │ ├── values.json │ └── completions_test.go ├── Powered-by-artifactory_01.png ├── .travis.yml ├── .gitignore ├── cmd ├── artif-cli │ └── main.go ├── artif-get-apikey │ └── main.go ├── artif-create-api-key │ └── main.go ├── artif-get-encrypted-password │ └── main.go ├── artif-get-general-configuration │ └── main.go ├── artif-get-security-configuration │ └── main.go ├── artif-delete-user │ └── main.go ├── artif-list-groups │ └── main.go ├── artif-get-license │ └── main.go ├── artif-list-permission-targets │ └── main.go ├── artif-deploy-artifact │ └── main.go ├── artif-list-files │ └── main.go ├── artif-list-repos │ └── main.go ├── artif-get-group │ └── main.go ├── artif-list-users │ ├── main.go │ └── README.md ├── artif-vagrant-search │ └── main.go ├── artif-get-artifact │ └── main.go ├── artif-get-user │ └── main.go ├── artif-create-user │ └── main.go └── artif-get-permission-target │ └── main.go ├── LICENSE ├── Gopkg.toml ├── Makefile └── Gopkg.lock /artifactory.v51/build.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v54/build.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v51/api_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v51/archive.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v51/bintray.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v51/build_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v51/compliance.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v51/http_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v51/repos_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v54/archive.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v54/bintray.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v54/build_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v54/compliance.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v54/http_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v401/api.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v401/build.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v491/build.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v51/archive_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v51/artifact_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v51/bintray_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v51/compliance_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v51/mimetypes_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v51/responses_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v51/search_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v51/security_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v51/storage_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v51/system_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v51/version_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v54/archive_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v54/artifact_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v54/bintray_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v54/compliance_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v54/mimetypes_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v54/responses_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v54/search_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v54/security_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /artifactory.v54/version_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v401/api_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v401/archive.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v401/bintray.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v401/build_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v401/compliance.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v401/http_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v401/repos_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v491/api_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v491/archive.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v491/bintray.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v491/build_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v491/compliance.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v491/http_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v491/repos_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v401/archive_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v401/artifact_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v401/bintray_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v401/compliance_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v401/mimetypes_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v401/responses_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v401/search_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v401/security_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v401/storage_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v401/system_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v401/version_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v491/archive_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v491/artifact_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v491/bintray_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v491/compliance_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v491/mimetypes_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v491/responses_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v491/search_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v491/security_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v491/storage_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v491/system_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /src/artifactory.v491/version_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | -------------------------------------------------------------------------------- /script/test: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | go test -v ./artifactory.v51 ./artifactory.v54 3 | -------------------------------------------------------------------------------- /script/build: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | go build ./artifactory.v51 ./artifactory.v54 4 | -------------------------------------------------------------------------------- /src/artifactory.v401/version.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | const VERSION = "4.0.1" 4 | -------------------------------------------------------------------------------- /src/artifactory.v491/version.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | const VERSION = "4.9.1" 4 | -------------------------------------------------------------------------------- /vendor/github.com/pmezard/go-difflib/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.5 4 | - tip 5 | 6 | -------------------------------------------------------------------------------- /Powered-by-artifactory_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lusis/go-artifactory/HEAD/Powered-by-artifactory_01.png -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/http/doc.go: -------------------------------------------------------------------------------- 1 | // Package http DEPRECATED USE net/http/httptest 2 | package http 3 | -------------------------------------------------------------------------------- /vendor/github.com/alecthomas/template/testdata/file1.tmpl: -------------------------------------------------------------------------------- 1 | {{define "x"}}TEXT{{end}} 2 | {{define "dotV"}}{{.V}}{{end}} 3 | -------------------------------------------------------------------------------- /vendor/github.com/alecthomas/template/testdata/tmpl1.tmpl: -------------------------------------------------------------------------------- 1 | template1 2 | {{define "x"}}x{{end}} 3 | {{template "y"}} 4 | -------------------------------------------------------------------------------- /vendor/github.com/alecthomas/template/testdata/tmpl2.tmpl: -------------------------------------------------------------------------------- 1 | template2 2 | {{define "y"}}y{{end}} 3 | {{template "x"}} 4 | -------------------------------------------------------------------------------- /src/artifactory.v491/api.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | type UserApiKey struct { 4 | ApiKey string `json:"apiKey"` 5 | } 6 | -------------------------------------------------------------------------------- /vendor/gopkg.in/alecthomas/kingpin.v2/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: go 3 | install: go get -t -v ./... 4 | go: 1.2 5 | -------------------------------------------------------------------------------- /artifactory.v51/assets/test/error.json: -------------------------------------------------------------------------------- 1 | { 2 | "errors" : [ { 3 | "status" : 404, 4 | "message" : "Not Found" 5 | } ] 6 | } 7 | -------------------------------------------------------------------------------- /artifactory.v54/assets/test/error.json: -------------------------------------------------------------------------------- 1 | { 2 | "errors" : [ { 3 | "status" : 404, 4 | "message" : "Not Found" 5 | } ] 6 | } 7 | -------------------------------------------------------------------------------- /vendor/github.com/lusis/outputter/script/test: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | go get github.com/jstemmer/go-junit-report > /dev/null 3 | go test -v . 4 | -------------------------------------------------------------------------------- /src/artifactory.v401/assets/test/error.json: -------------------------------------------------------------------------------- 1 | { 2 | "errors" : [ { 3 | "status" : 404, 4 | "message" : "Not Found" 5 | } ] 6 | } 7 | -------------------------------------------------------------------------------- /src/artifactory.v491/assets/test/error.json: -------------------------------------------------------------------------------- 1 | { 2 | "errors" : [ { 3 | "status" : 404, 4 | "message" : "Not Found" 5 | } ] 6 | } 7 | -------------------------------------------------------------------------------- /vendor/github.com/alecthomas/template/testdata/file2.tmpl: -------------------------------------------------------------------------------- 1 | {{define "dot"}}{{.}}{{end}} 2 | {{define "nested"}}{{template "dot" .}}{{end}} 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.7.x 5 | - 1.8.x 6 | - 1.9.x 7 | - tip 8 | 9 | script: 10 | - make all 11 | 12 | -------------------------------------------------------------------------------- /vendor/github.com/olekukonko/tablewriter/test.csv: -------------------------------------------------------------------------------- 1 | first_name,last_name,ssn 2 | John,Barry,123456 3 | Kathy,Smith,687987 4 | Bob,McCornick,3979870 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .env.local 2 | .env.local.leave 3 | xmlfiles/ 4 | bin/ 5 | pkg/ 6 | src/github.com/ 7 | src/gopkg.in/ 8 | debug 9 | debug.test 10 | -------------------------------------------------------------------------------- /artifactory.v51/assets/test/license_information.json: -------------------------------------------------------------------------------- 1 | { 2 | "type" : "Trial", 3 | "validThrough" : "Sep 30, 2015", 4 | "licensedTo" : "User Bob" 5 | } 6 | -------------------------------------------------------------------------------- /artifactory.v54/assets/test/license_information.json: -------------------------------------------------------------------------------- 1 | { 2 | "type" : "Trial", 3 | "validThrough" : "Sep 30, 2015", 4 | "licensedTo" : "User Bob" 5 | } 6 | -------------------------------------------------------------------------------- /src/artifactory.v401/assets/test/license_information.json: -------------------------------------------------------------------------------- 1 | { 2 | "type" : "Trial", 3 | "validThrough" : "Sep 30, 2015", 4 | "licensedTo" : "User Bob" 5 | } 6 | -------------------------------------------------------------------------------- /src/artifactory.v491/assets/test/license_information.json: -------------------------------------------------------------------------------- 1 | { 2 | "type" : "Trial", 3 | "validThrough" : "Sep 30, 2015", 4 | "licensedTo" : "User Bob" 5 | } 6 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-semver/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | go: 4 | - 1.4 5 | - 1.5 6 | - 1.6 7 | - tip 8 | script: cd semver && go test 9 | -------------------------------------------------------------------------------- /artifactory.v51/version.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | // VERSION represents the minimum version of the Artifactory API this library supports 4 | const VERSION = "5.1" 5 | -------------------------------------------------------------------------------- /script/coverage: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | go get github.com/axw/gocov/gocov 3 | 4 | gocov test ./artifactory.v51 | gocov report 5 | 6 | gocov test ./artifactory.v54 | gocov report 7 | -------------------------------------------------------------------------------- /vendor/github.com/lusis/outputter/example/color/color-table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lusis/go-artifactory/HEAD/vendor/github.com/lusis/outputter/example/color/color-table.png -------------------------------------------------------------------------------- /artifactory.v51/assets/test/single_group.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "docker-readers", 3 | "description" : "Can read from Docker repositories", 4 | "autoJoin" : false, 5 | "realm" : "artifactory" 6 | } -------------------------------------------------------------------------------- /vendor/github.com/olekukonko/tablewriter/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.1 5 | - 1.2 6 | - 1.3 7 | - 1.4 8 | - 1.5 9 | - 1.6 10 | - 1.7 11 | - 1.8 12 | - tip 13 | -------------------------------------------------------------------------------- /artifactory.v51/api.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | // UserAPIKey represents the JSON returned for a user's API Key in Artifactory 4 | type UserAPIKey struct { 5 | APIKey string `json:"apiKey"` 6 | } 7 | -------------------------------------------------------------------------------- /src/artifactory.v401/assets/test/single_group.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "docker-readers", 3 | "description" : "Can read from Docker repositories", 4 | "autoJoin" : false, 5 | "realm" : "artifactory" 6 | } -------------------------------------------------------------------------------- /src/artifactory.v491/assets/test/single_group.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "docker-readers", 3 | "description" : "Can read from Docker repositories", 4 | "autoJoin" : false, 5 | "realm" : "artifactory" 6 | } -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/Godeps/Readme: -------------------------------------------------------------------------------- 1 | This directory tree is generated automatically by godep. 2 | 3 | Please do not edit. 4 | 5 | See https://github.com/tools/godep for more information. 6 | -------------------------------------------------------------------------------- /vendor/github.com/lusis/outputter/script/coverage: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | go get github.com/axw/gocov/gocov 3 | go get gopkg.in/matm/v1/gocov-html 4 | go get github.com/AlekSi/gocov-xml 5 | gocov test . | gocov report 6 | -------------------------------------------------------------------------------- /vendor/github.com/olekukonko/tablewriter/test_info.csv: -------------------------------------------------------------------------------- 1 | Field,Type,Null,Key,Default,Extra 2 | user_id,smallint(5),NO,PRI,NULL,auto_increment 3 | username,varchar(10),NO,,NULL, 4 | password,varchar(100),NO,,NULL, -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/require_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) { 3 | {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 4 | } 5 | -------------------------------------------------------------------------------- /artifactory.v54/assets/test/docker_repository_tags.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "docker-dev", 3 | "tags": [ 4 | "0.1.0", 5 | "0.2.0", 6 | "0.3.0", 7 | "0.4.0", 8 | "0.5.0" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /artifactory.v54/assets/test/version_information.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "5.4.6", 3 | "revision": "50406900", 4 | "addons": [ "build", "ldap", "properties", "rest", "search", "sso", "watch", "webstart" ] 5 | } 6 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) bool { 3 | return {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 4 | } 5 | -------------------------------------------------------------------------------- /src/artifactory.v401/responses.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | type GavcSearchResults struct { 4 | Results []FileInfo `json:"results"` 5 | } 6 | 7 | type Uri struct { 8 | Uri string `json:"uri,omitempty"` 9 | } 10 | -------------------------------------------------------------------------------- /src/artifactory.v491/responses.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | type GavcSearchResults struct { 4 | Results []FileInfo `json:"results"` 5 | } 6 | 7 | type Uri struct { 8 | Uri string `json:"uri,omitempty"` 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/require.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.Comment}} 2 | func {{.DocInfo.Name}}(t TestingT, {{.Params}}) { 3 | if !assert.{{.DocInfo.Name}}(t, {{.ForwardedParams}}) { 4 | t.FailNow() 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /artifactory.v54/assets/test/item_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "http://localhost:8081/artifactory/api/storage/libs-release-local/org/acme", 3 | "properties": { 4 | "p1": ["v1","v2","v3"], 5 | "p2": ["v4","v5","v6"] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/artifactory.v401/system.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | func (c *ArtifactoryClient) GetGeneralConfiguration() (s string, e error) { 4 | d, e := c.Get("/api/system/configuration", make(map[string]string)) 5 | return string(d), e 6 | } 7 | -------------------------------------------------------------------------------- /src/artifactory.v491/system.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | func (c *ArtifactoryClient) GetGeneralConfiguration() (s string, e error) { 4 | d, e := c.Get("/api/system/configuration", make(map[string]string)) 5 | return string(d), e 6 | } 7 | -------------------------------------------------------------------------------- /artifactory.v54/assets/test/docker_repositories.json: -------------------------------------------------------------------------------- 1 | { 2 | "repositories": [ 3 | "docker-dev", 4 | "docker-test", 5 | "docker-stage", 6 | "docker-prod", 7 | "hello-world", 8 | "hello-cloud" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /src/artifactory.v401/security.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | func (c *ArtifactoryClient) GetSystemSecurityConfiguration() (s string, e error) { 4 | d, e := c.Get("/api/system/security", make(map[string]string)) 5 | return string(d), e 6 | } 7 | -------------------------------------------------------------------------------- /src/artifactory.v491/security.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | func (c *ArtifactoryClient) GetSystemSecurityConfiguration() (s string, e error) { 4 | d, e := c.Get("/api/system/security", make(map[string]string)) 5 | return string(d), e 6 | } 7 | -------------------------------------------------------------------------------- /vendor/gopkg.in/alecthomas/kingpin.v2/guesswidth.go: -------------------------------------------------------------------------------- 1 | // +build appengine !linux,!freebsd,!darwin,!dragonfly,!netbsd,!openbsd 2 | 3 | package kingpin 4 | 5 | import "io" 6 | 7 | func guessWidth(w io.Writer) int { 8 | return 80 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/runewidth_js.go: -------------------------------------------------------------------------------- 1 | // +build js 2 | 3 | package runewidth 4 | 5 | func IsEastAsian() bool { 6 | // TODO: Implement this for the web. Detect east asian in a compatible way, and return true. 7 | return false 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | sudo: false 4 | 5 | go: 6 | - 1.1 7 | - 1.2 8 | - 1.3 9 | - 1.4 10 | - 1.5 11 | - 1.6 12 | - 1.7 13 | - tip 14 | 15 | script: 16 | - go test -v ./... 17 | -------------------------------------------------------------------------------- /src/artifactory.v401/errors.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | type ErrorsJson struct { 4 | Errors []ErrorJson `json:"errors"` 5 | } 6 | 7 | type ErrorJson struct { 8 | Status string `json:"status"` 9 | Message string `json:"message"` 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/lusis/outputter/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.7.x 5 | - 1.8.x 6 | - 1.9.x 7 | - tip 8 | 9 | install: 10 | - echo "true" 11 | 12 | script: 13 | - script/lint 14 | - script/coverage 15 | - script/test -------------------------------------------------------------------------------- /artifactory.v54/assets/test/single_group.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "docker-readers", 3 | "description" : "Can read from Docker repositories", 4 | "autoJoin" : false, 5 | "realm" : "artifactory", 6 | "realmAttributes": "Realm attributes for use by LDAP" 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - tip 4 | before_install: 5 | - go get github.com/mattn/goveralls 6 | - go get golang.org/x/tools/cmd/cover 7 | script: 8 | - $HOME/gopath/bin/goveralls -repotoken lAKAWPzcGsD3A8yBX3BGGtRUdJ6CaGERL 9 | -------------------------------------------------------------------------------- /artifactory.v51/assets/test/users.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "davids", 4 | "uri" : "http://localhost:8080/artifactory/api/security/users/davids" 5 | }, { 6 | "name": "danl", 7 | "uri" : "http://localhost:8080/artifactory/api/security/users/danl" 8 | } 9 | ] 10 | -------------------------------------------------------------------------------- /artifactory.v54/assets/test/users.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "davids", 4 | "uri" : "http://localhost:8080/artifactory/api/security/users/davids" 5 | }, { 6 | "name": "danl", 7 | "uri" : "http://localhost:8080/artifactory/api/security/users/danl" 8 | } 9 | ] 10 | -------------------------------------------------------------------------------- /src/artifactory.v401/assets/test/users.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "davids", 4 | "uri" : "http://localhost:8080/artifactory/api/security/users/davids" 5 | }, { 6 | "name": "danl", 7 | "uri" : "http://localhost:8080/artifactory/api/security/users/danl" 8 | } 9 | ] 10 | -------------------------------------------------------------------------------- /src/artifactory.v491/assets/test/users.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "davids", 4 | "uri" : "http://localhost:8080/artifactory/api/security/users/davids" 5 | }, { 6 | "name": "danl", 7 | "uri" : "http://localhost:8080/artifactory/api/security/users/danl" 8 | } 9 | ] 10 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/package_test.go: -------------------------------------------------------------------------------- 1 | package testify 2 | 3 | import ( 4 | "github.com/stretchr/testify/assert" 5 | "testing" 6 | ) 7 | 8 | func TestImports(t *testing.T) { 9 | if assert.Equal(t, 1, 1) != true { 10 | t.Error("Something is wrong.") 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /artifactory.v51/system.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | // GetGeneralConfiguration returns the general artifactory configuration 4 | func (c *Client) GetGeneralConfiguration() (s string, e error) { 5 | d, e := c.Get("/api/system/configuration", make(map[string]string)) 6 | return string(d), e 7 | } 8 | -------------------------------------------------------------------------------- /src/artifactory.v491/errors.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | type ErrorsJson struct { 4 | Errors []ErrorJson `json:"errors,omitempty"` 5 | Error string `json:"error,omitempty"` 6 | } 7 | 8 | type ErrorJson struct { 9 | Status string `json:"status"` 10 | Message string `json:"message"` 11 | } 12 | -------------------------------------------------------------------------------- /artifactory.v51/responses.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | // GavcSearchResults represents gavc search results 4 | type GavcSearchResults struct { 5 | Results []FileInfo `json:"results"` 6 | } 7 | 8 | // URI is a URI in artifactory json 9 | type URI struct { 10 | URI string `json:"uri,omitempty"` 11 | } 12 | -------------------------------------------------------------------------------- /artifactory.v54/responses.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | // GavcSearchResults represents gavc search results 4 | type GavcSearchResults struct { 5 | Results []FileInfo `json:"results"` 6 | } 7 | 8 | // URI is a URI in artifactory json 9 | type URI struct { 10 | URI string `json:"uri,omitempty"` 11 | } 12 | -------------------------------------------------------------------------------- /artifactory.v51/security.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | // GetSystemSecurityConfiguration returns the security configuration for the artifactory server 4 | func (c *Client) GetSystemSecurityConfiguration() (s string, e error) { 5 | d, e := c.Get("/api/system/security", make(map[string]string)) 6 | return string(d), e 7 | } 8 | -------------------------------------------------------------------------------- /artifactory.v54/security.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | // GetSystemSecurityConfiguration returns the security configuration for the artifactory server 4 | func (c *Client) GetSystemSecurityConfiguration() (s string, e error) { 5 | d, e := c.Get("/api/system/security", make(map[string]string)) 6 | return string(d), e 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/requirements.go: -------------------------------------------------------------------------------- 1 | package require 2 | 3 | // TestingT is an interface wrapper around *testing.T 4 | type TestingT interface { 5 | Errorf(format string, args ...interface{}) 6 | FailNow() 7 | } 8 | 9 | //go:generate go run ../_codegen/main.go -output-package=require -template=require.go.tmpl 10 | -------------------------------------------------------------------------------- /artifactory.v51/assets/test/single_user.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "admin", 3 | "email" : "admin@admin.com", 4 | "admin" : true, 5 | "profileUpdatable" : true, 6 | "internalPasswordDisabled" : false, 7 | "groups" : [ "administrators" ], 8 | "lastLoggedIn" : "2015-08-11T14:04:11.472Z", 9 | "realm" : "internal", 10 | "offlineMode" : false 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/lusis/outputter/example/custom-output/README.md: -------------------------------------------------------------------------------- 1 | # custom outputters 2 | 3 | This shows how to create your own custom outputter, register it and use it. 4 | 5 | ## output 6 | 7 | ```text 8 | 2017/11/06 13:00:33 found outputters: json,table,tabular,myoutput 9 | here's my data! 10 | header1:value1 11 | header2:value2 12 | header3:value3 13 | ``` -------------------------------------------------------------------------------- /artifactory.v51/assets/test/permissions_details.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "release-commiter", 3 | "includesPattern" : "**", 4 | "excludesPattern" : "", 5 | "repositories" : [ "docker-local-v2", "libs-release-local", "plugins-release-local" ], 6 | "principals" : { 7 | "groups" : { 8 | "java-committers" : [ "r", "d", "w", "n" ] 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /src/artifactory.v401/assets/test/single_user.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "admin", 3 | "email" : "admin@admin.com", 4 | "admin" : true, 5 | "profileUpdatable" : true, 6 | "internalPasswordDisabled" : false, 7 | "groups" : [ "administrators" ], 8 | "lastLoggedIn" : "2015-08-11T14:04:11.472Z", 9 | "realm" : "internal", 10 | "offlineMode" : false 11 | } 12 | -------------------------------------------------------------------------------- /src/artifactory.v491/assets/test/single_user.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "admin", 3 | "email" : "admin@admin.com", 4 | "admin" : true, 5 | "profileUpdatable" : true, 6 | "internalPasswordDisabled" : false, 7 | "groups" : [ "administrators" ], 8 | "lastLoggedIn" : "2015-08-11T14:04:11.472Z", 9 | "realm" : "internal", 10 | "offlineMode" : false 11 | } 12 | -------------------------------------------------------------------------------- /src/artifactory.v401/assets/test/permissions_details.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "release-commiter", 3 | "includesPattern" : "**", 4 | "excludesPattern" : "", 5 | "repositories" : [ "docker-local-v2", "libs-release-local", "plugins-release-local" ], 6 | "principals" : { 7 | "groups" : { 8 | "java-committers" : [ "r", "d", "w", "n" ] 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /src/artifactory.v491/assets/test/permissions_details.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "release-commiter", 3 | "includesPattern" : "**", 4 | "excludesPattern" : "", 5 | "repositories" : [ "docker-local-v2", "libs-release-local", "plugins-release-local" ], 6 | "principals" : { 7 | "groups" : { 8 | "java-committers" : [ "r", "d", "w", "n" ] 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /vendor/github.com/alecthomas/units/README.md: -------------------------------------------------------------------------------- 1 | # Units - Helpful unit multipliers and functions for Go 2 | 3 | The goal of this package is to have functionality similar to the [time](http://golang.org/pkg/time/) package. 4 | 5 | It allows for code like this: 6 | 7 | ```go 8 | n, err := ParseBase2Bytes("1KB") 9 | // n == 1024 10 | n = units.Mebibyte * 512 11 | ``` 12 | -------------------------------------------------------------------------------- /cmd/artif-cli/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | artifactory "github.com/lusis/go-artifactory/artifactory.v54" 8 | ) 9 | 10 | func main() { 11 | client, clientErr := artifactory.NewClientFromEnv() 12 | if clientErr != nil { 13 | fmt.Printf("%s\n", clientErr.Error()) 14 | os.Exit(1) 15 | } 16 | 17 | fmt.Printf("%#v\n", client) 18 | } 19 | -------------------------------------------------------------------------------- /artifactory.v54/assets/test/single_user.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "admin", 3 | "email" : "admin@admin.com", 4 | "password" : "somepass", 5 | "admin" : true, 6 | "profileUpdatable" : true, 7 | "disableUIAccess": false, 8 | "internalPasswordDisabled" : false, 9 | "groups" : [ "administrators" ], 10 | "lastLoggedIn" : "2015-08-11T14:04:11.472Z", 11 | "realm" : "internal" 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/errors.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | // AnError is an error instance useful for testing. If the code does not care 8 | // about error specifics, and only needs to return the error for example, this 9 | // error should be used to make the test code more readable. 10 | var AnError = errors.New("assert.AnError general error for testing") 11 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | 24 | .DS_Store 25 | -------------------------------------------------------------------------------- /vendor/github.com/alecthomas/units/doc.go: -------------------------------------------------------------------------------- 1 | // Package units provides helpful unit multipliers and functions for Go. 2 | // 3 | // The goal of this package is to have functionality similar to the time [1] package. 4 | // 5 | // 6 | // [1] http://golang.org/pkg/time/ 7 | // 8 | // It allows for code like this: 9 | // 10 | // n, err := ParseBase2Bytes("1KB") 11 | // // n == 1024 12 | // n = units.Mebibyte * 512 13 | package units 14 | -------------------------------------------------------------------------------- /artifactory.v54/assets/test/permissions_details.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "release-commiter", 3 | "includesPattern" : "**", 4 | "excludesPattern" : "", 5 | "repositories" : [ "docker-local-v2", "libs-release-local", "plugins-release-local" ], 6 | "principals" : { 7 | "users" : { 8 | "admin" : [ "r", "d", "w", "n", "m" ] 9 | }, 10 | "groups" : { 11 | "java-committers" : [ "r", "d", "w", "n" ] 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-semver/example.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "github.com/coreos/go-semver/semver" 6 | "os" 7 | ) 8 | 9 | func main() { 10 | vA, err := semver.NewVersion(os.Args[1]) 11 | if err != nil { 12 | fmt.Println(err.Error()) 13 | } 14 | vB, err := semver.NewVersion(os.Args[2]) 15 | if err != nil { 16 | fmt.Println(err.Error()) 17 | } 18 | 19 | fmt.Printf("%s < %s == %t\n", vA, vB, vA.LessThan(*vB)) 20 | } 21 | -------------------------------------------------------------------------------- /artifactory.v51/errors.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | // ErrorsJSON represents a group of error messages returned by the artifactory api 4 | type ErrorsJSON struct { 5 | Errors []ErrorJSON `json:"errors,omitempty"` 6 | Error string `json:"error,omitempty"` 7 | } 8 | 9 | // ErrorJSON represents a single error message returned by the artifactory API 10 | type ErrorJSON struct { 11 | Status string `json:"status"` 12 | Message string `json:"message"` 13 | } 14 | -------------------------------------------------------------------------------- /artifactory.v54/errors.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | // ErrorsJSON represents a group of error messages returned by the artifactory api 4 | type ErrorsJSON struct { 5 | Errors []ErrorJSON `json:"errors,omitempty"` 6 | Error string `json:"error,omitempty"` 7 | } 8 | 9 | // ErrorJSON represents a single error message returned by the artifactory API 10 | type ErrorJSON struct { 11 | Status string `json:"status"` 12 | Message string `json:"message"` 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.5.4 4 | - 1.6.3 5 | - 1.7 6 | install: 7 | - go get -v golang.org/x/tools/cmd/cover 8 | script: 9 | - go test -v -tags=safe ./spew 10 | - go test -v -tags=testcgo ./spew -covermode=count -coverprofile=profile.cov 11 | after_success: 12 | - go get -v github.com/mattn/goveralls 13 | - export PATH=$PATH:$HOME/gopath/bin 14 | - goveralls -coverprofile=profile.cov -service=travis-ci 15 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/forward_assertions.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate go run ../_codegen/main.go -output-package=assert -template=assertion_forward.go.tmpl 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/forward_requirements.go: -------------------------------------------------------------------------------- 1 | package require 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate go run ../_codegen/main.go -output-package=require -template=require_forward.go.tmpl 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/http/test_round_tripper.go: -------------------------------------------------------------------------------- 1 | package http 2 | 3 | import ( 4 | "github.com/stretchr/testify/mock" 5 | "net/http" 6 | ) 7 | 8 | // TestRoundTripper DEPRECATED USE net/http/httptest 9 | type TestRoundTripper struct { 10 | mock.Mock 11 | } 12 | 13 | // RoundTrip DEPRECATED USE net/http/httptest 14 | func (t *TestRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { 15 | args := t.Called(req) 16 | return args.Get(0).(*http.Response), args.Error(1) 17 | } 18 | -------------------------------------------------------------------------------- /cmd/artif-get-apikey/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | artifactory "github.com/lusis/go-artifactory/artifactory.v54" 8 | ) 9 | 10 | func main() { 11 | client, clientErr := artifactory.NewClientFromEnv() 12 | if clientErr != nil { 13 | fmt.Printf("%s\n", clientErr.Error()) 14 | os.Exit(1) 15 | } 16 | p, err := client.GetUserAPIKey() 17 | if err != nil { 18 | fmt.Printf("%s\n", err) 19 | os.Exit(1) 20 | } else { 21 | fmt.Printf("%s\n", p) 22 | os.Exit(0) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /cmd/artif-create-api-key/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | artifactory "github.com/lusis/go-artifactory/artifactory.v54" 8 | ) 9 | 10 | func main() { 11 | client, clientErr := artifactory.NewClientFromEnv() 12 | if clientErr != nil { 13 | fmt.Printf("%s\n", clientErr.Error()) 14 | 15 | } else { 16 | p, err := client.CreateUserAPIKey() 17 | if err != nil { 18 | fmt.Printf("%s\n", err) 19 | os.Exit(1) 20 | } else { 21 | fmt.Printf("%s\n", p) 22 | os.Exit(0) 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/alecthomas/template/README.md: -------------------------------------------------------------------------------- 1 | # Go's `text/template` package with newline elision 2 | 3 | This is a fork of Go 1.4's [text/template](http://golang.org/pkg/text/template/) package with one addition: a backslash immediately after a closing delimiter will delete all subsequent newlines until a non-newline. 4 | 5 | eg. 6 | 7 | ``` 8 | {{if true}}\ 9 | hello 10 | {{end}}\ 11 | ``` 12 | 13 | Will result in: 14 | 15 | ``` 16 | hello\n 17 | ``` 18 | 19 | Rather than: 20 | 21 | ``` 22 | \n 23 | hello\n 24 | \n 25 | ``` 26 | -------------------------------------------------------------------------------- /cmd/artif-get-encrypted-password/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | artifactory "github.com/lusis/go-artifactory/artifactory.v54" 8 | ) 9 | 10 | func main() { 11 | client, clientErr := artifactory.NewClientFromEnv() 12 | if clientErr != nil { 13 | fmt.Printf("%s\n", clientErr.Error()) 14 | os.Exit(1) 15 | } 16 | p, err := client.GetUserEncryptedPassword() 17 | if err != nil { 18 | fmt.Printf("%s\n", err) 19 | os.Exit(1) 20 | } else { 21 | fmt.Printf("%s\n", p) 22 | os.Exit(0) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /cmd/artif-get-general-configuration/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | artifactory "github.com/lusis/go-artifactory/artifactory.v54" 8 | ) 9 | 10 | func main() { 11 | client, clientErr := artifactory.NewClientFromEnv() 12 | if clientErr != nil { 13 | fmt.Printf("%s\n", clientErr.Error()) 14 | os.Exit(1) 15 | } 16 | p, err := client.GetGeneralConfiguration() 17 | if err != nil { 18 | fmt.Printf("%s\n", err) 19 | os.Exit(1) 20 | } else { 21 | fmt.Printf("%s\n", p) 22 | os.Exit(0) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /cmd/artif-get-security-configuration/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | artifactory "github.com/lusis/go-artifactory/artifactory.v54" 8 | ) 9 | 10 | func main() { 11 | client, clientErr := artifactory.NewClientFromEnv() 12 | if clientErr != nil { 13 | fmt.Printf("%s\n", clientErr.Error()) 14 | os.Exit(1) 15 | } 16 | p, err := client.GetSystemSecurityConfiguration() 17 | if err != nil { 18 | fmt.Printf("%s\n", err) 19 | os.Exit(1) 20 | } else { 21 | fmt.Printf("%s\n", p) 22 | os.Exit(0) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /artifactory.v54/assets/test/generic_repository_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "key" : "libs-release-local", 3 | "rclass" : "", 4 | "packageType" : "maven", 5 | "description" : "Local repository for in-house libraries", 6 | "notes" : "", 7 | "includesPattern" : "**/*", 8 | "excludesPattern" : "", 9 | "repoLayoutRef" : "maven-2-default", 10 | "handleReleases" : true, 11 | "handleSnapshots" : false, 12 | "maxUniqueSnapshots" : 0, 13 | "suppressPomConsistencyChecks" : true, 14 | "blackedOut" : false, 15 | "propertySets" : [ "artifactory" ] 16 | } 17 | -------------------------------------------------------------------------------- /script/lint: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | go get -u github.com/alecthomas/gometalinter 3 | gometalinter --install > /dev/null 4 | 5 | 6 | gometalinter \ 7 | --vendor \ 8 | --disable-all \ 9 | --enable=vet \ 10 | --enable=vetshadow \ 11 | --enable=golint \ 12 | --enable=ineffassign \ 13 | --enable=goconst \ 14 | --enable=goimports \ 15 | --enable=deadcode \ 16 | --enable=gosimple \ 17 | --enable=errcheck \ 18 | --tests \ 19 | --deadline=30s \ 20 | --exclude=/usr/local/go/src/ \ 21 | ./artifactory.v51 ./artifactory.v54 22 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/runewidth_windows.go: -------------------------------------------------------------------------------- 1 | package runewidth 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | var ( 8 | kernel32 = syscall.NewLazyDLL("kernel32") 9 | procGetConsoleOutputCP = kernel32.NewProc("GetConsoleOutputCP") 10 | ) 11 | 12 | // IsEastAsian return true if the current locale is CJK 13 | func IsEastAsian() bool { 14 | r1, _, _ := procGetConsoleOutputCP.Call() 15 | if r1 == 0 { 16 | return false 17 | } 18 | 19 | switch int(r1) { 20 | case 932, 51932, 936, 949, 950: 21 | return true 22 | } 23 | 24 | return false 25 | } 26 | -------------------------------------------------------------------------------- /artifactory.v54/assets/test/virtual_repository_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "key" : "libs-release", 3 | "rclass" : "virtual", 4 | "packageType" : "maven", 5 | "description" : "", 6 | "notes" : "", 7 | "includesPattern" : "**/*", 8 | "excludesPattern" : "", 9 | "repositories" : [ "libs-release-local", "ext-release-local", "remote-repos" ], 10 | "debianTrivialLayout" : false, 11 | "artifactoryRequestsCanRetrieveRemoteArtifacts" : false, 12 | "keyPair" : "", 13 | "pomRepositoryReferencesCleanupPolicy" : "discard_active_reference", 14 | "defaultDeploymentRepo" : "libs-release-local" 15 | } 16 | -------------------------------------------------------------------------------- /artifactory.v54/version.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | import "github.com/coreos/go-semver/semver" 4 | 5 | var ( 6 | // VersionMajor is for an API incompatible changes 7 | VersionMajor int64 = 5 8 | // VersionMinor is for functionality in a backwards-compatible manner 9 | VersionMinor int64 = 4 10 | // VersionPatch is for backwards-compatible bug fixes 11 | VersionPatch int64 12 | ) 13 | 14 | // Version represents the minimum version of the Artifactory API this library supports 15 | var Version = semver.Version{ 16 | Major: VersionMajor, 17 | Minor: VersionMinor, 18 | Patch: VersionPatch, 19 | } 20 | -------------------------------------------------------------------------------- /src/artifactory.v401/license.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | type LicenseInformation struct { 8 | LicenseType string `json:"type"` 9 | ValidThrough string `json:"validThrough"` 10 | LicensedTo string `json:"licensedTo"` 11 | } 12 | 13 | func (c *ArtifactoryClient) GetLicenseInformation() (LicenseInformation, error) { 14 | o := make(map[string]string, 0) 15 | var l LicenseInformation 16 | d, e := c.Get("/api/system/license", o) 17 | if e != nil { 18 | return l, e 19 | } else { 20 | err := json.Unmarshal(d, &l) 21 | return l, err 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/artifactory.v491/license.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | type LicenseInformation struct { 8 | LicenseType string `json:"type"` 9 | ValidThrough string `json:"validThrough"` 10 | LicensedTo string `json:"licensedTo"` 11 | } 12 | 13 | func (c *ArtifactoryClient) GetLicenseInformation() (LicenseInformation, error) { 14 | o := make(map[string]string, 0) 15 | var l LicenseInformation 16 | d, e := c.Get("/api/system/license", o) 17 | if e != nil { 18 | return l, e 19 | } else { 20 | err := json.Unmarshal(d, &l) 21 | return l, err 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/lusis/outputter/example/kingpin/README.md: -------------------------------------------------------------------------------- 1 | # kingpin examples 2 | 3 | ## tabular 4 | 5 | `go run main.go` 6 | 7 | ```text 8 | header1 header2 header3 9 | value1 value2 value3 10 | ``` 11 | 12 | ## json 13 | 14 | `go run main.go --format json` 15 | 16 | ```text 17 | [{"header1":"value1","header2":"value2","header3":"value3"}] 18 | ``` 19 | 20 | ## table 21 | 22 | `go run main.go --format table` 23 | 24 | ```text 25 | +---------+---------+---------+ 26 | | HEADER1 | HEADER2 | HEADER3 | 27 | +---------+---------+---------+ 28 | | value1 | value2 | value3 | 29 | +---------+---------+---------+ 30 | ``` -------------------------------------------------------------------------------- /vendor/github.com/lusis/outputter/example/stdlib/README.md: -------------------------------------------------------------------------------- 1 | # stdlib `flag` examples 2 | 3 | ## tabular 4 | 5 | `go run main.go` 6 | 7 | ```text 8 | header1 header2 header3 9 | value1 value2 value3 10 | ``` 11 | 12 | ## json 13 | 14 | `go run main.go --format json` 15 | 16 | ```text 17 | [{"header1":"value1","header2":"value2","header3":"value3"}] 18 | ``` 19 | 20 | ## table 21 | 22 | `go run main.go --format table` 23 | 24 | ```text 25 | +---------+---------+---------+ 26 | | HEADER1 | HEADER2 | HEADER3 | 27 | +---------+---------+---------+ 28 | | value1 | value2 | value3 | 29 | +---------+---------+---------+ 30 | ``` -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License, Version 2.0 2 | 3 | Copyright (c) 2016 John E. Vincent 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | -------------------------------------------------------------------------------- /artifactory.v51/assets/test/groups.json: -------------------------------------------------------------------------------- 1 | [ { 2 | "name" : "administrators", 3 | "uri" : "https://artifactory/artifactory/api/security/groups/administrators" 4 | }, { 5 | "name" : "docker-readers", 6 | "uri" : "https://artifactory/artifactory/api/security/groups/docker-readers" 7 | }, { 8 | "name" : "remote-readers", 9 | "uri" : "https://artifactory/artifactory/api/security/groups/remote-readers" 10 | }, { 11 | "name" : "developers", 12 | "uri" : "https://artifactory/artifactory/api/security/groups/developers" 13 | }, { 14 | "name" : "java-committers", 15 | "uri" : "https://artifactory/artifactory/api/security/groups/java-committers" 16 | } ] 17 | -------------------------------------------------------------------------------- /artifactory.v54/assets/test/groups.json: -------------------------------------------------------------------------------- 1 | [ { 2 | "name" : "administrators", 3 | "uri" : "https://artifactory/artifactory/api/security/groups/administrators" 4 | }, { 5 | "name" : "docker-readers", 6 | "uri" : "https://artifactory/artifactory/api/security/groups/docker-readers" 7 | }, { 8 | "name" : "remote-readers", 9 | "uri" : "https://artifactory/artifactory/api/security/groups/remote-readers" 10 | }, { 11 | "name" : "developers", 12 | "uri" : "https://artifactory/artifactory/api/security/groups/developers" 13 | }, { 14 | "name" : "java-committers", 15 | "uri" : "https://artifactory/artifactory/api/security/groups/java-committers" 16 | } ] 17 | -------------------------------------------------------------------------------- /vendor/github.com/lusis/outputter/script/lint: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | go get -u github.com/alecthomas/gometalinter > /dev/null 3 | gometalinter --install > /dev/null 4 | if [ $? -ne 0 ]; then 5 | printf -- "failed to install linters\n" 6 | exit 1 7 | fi 8 | 9 | gometalinter \ 10 | --vendor \ 11 | --disable-all \ 12 | --enable=vet \ 13 | --enable=vetshadow \ 14 | --enable=golint \ 15 | --enable=ineffassign \ 16 | --enable=goconst \ 17 | --enable=goimports \ 18 | --enable=deadcode \ 19 | --enable=gosimple \ 20 | --enable=errcheck \ 21 | --tests \ 22 | --deadline=30s \ 23 | --exclude=/usr/local/go/src/ \ 24 | . 25 | -------------------------------------------------------------------------------- /src/artifactory.v401/assets/test/groups.json: -------------------------------------------------------------------------------- 1 | [ { 2 | "name" : "administrators", 3 | "uri" : "https://artifactory/artifactory/api/security/groups/administrators" 4 | }, { 5 | "name" : "docker-readers", 6 | "uri" : "https://artifactory/artifactory/api/security/groups/docker-readers" 7 | }, { 8 | "name" : "remote-readers", 9 | "uri" : "https://artifactory/artifactory/api/security/groups/remote-readers" 10 | }, { 11 | "name" : "developers", 12 | "uri" : "https://artifactory/artifactory/api/security/groups/developers" 13 | }, { 14 | "name" : "java-committers", 15 | "uri" : "https://artifactory/artifactory/api/security/groups/java-committers" 16 | } ] 17 | -------------------------------------------------------------------------------- /src/artifactory.v491/assets/test/groups.json: -------------------------------------------------------------------------------- 1 | [ { 2 | "name" : "administrators", 3 | "uri" : "https://artifactory/artifactory/api/security/groups/administrators" 4 | }, { 5 | "name" : "docker-readers", 6 | "uri" : "https://artifactory/artifactory/api/security/groups/docker-readers" 7 | }, { 8 | "name" : "remote-readers", 9 | "uri" : "https://artifactory/artifactory/api/security/groups/remote-readers" 10 | }, { 11 | "name" : "developers", 12 | "uri" : "https://artifactory/artifactory/api/security/groups/developers" 13 | }, { 14 | "name" : "java-committers", 15 | "uri" : "https://artifactory/artifactory/api/security/groups/java-committers" 16 | } ] 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/Godeps/Godeps.json: -------------------------------------------------------------------------------- 1 | { 2 | "ImportPath": "github.com/stretchr/testify", 3 | "GoVersion": "go1.5", 4 | "GodepVersion": "v74", 5 | "Packages": [ 6 | "./..." 7 | ], 8 | "Deps": [ 9 | { 10 | "ImportPath": "github.com/davecgh/go-spew/spew", 11 | "Comment": "v1.0.0-3-g6d21280", 12 | "Rev": "6d212800a42e8ab5c146b8ace3490ee17e5225f9" 13 | }, 14 | { 15 | "ImportPath": "github.com/pmezard/go-difflib/difflib", 16 | "Rev": "d8ed2627bdf02c080bf22230dbb337003b7aba2d" 17 | }, 18 | { 19 | "ImportPath": "github.com/stretchr/objx", 20 | "Rev": "cbeaeb16a013161a98496fad62933b1d21786672" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /artifactory.v51/assets/test/permissions.json: -------------------------------------------------------------------------------- 1 | [ { 2 | "name" : "snapshot-write", 3 | "uri" : "https://artifactory/artifactory/api/security/permissions/snapshot-write" 4 | }, { 5 | "name" : "Any Remote", 6 | "uri" : "https://artifactory/artifactory/api/security/permissions/Any%20Remote" 7 | }, { 8 | "name" : "Anything", 9 | "uri" : "https://artifactory/artifactory/api/security/permissions/Anything" 10 | }, { 11 | "name" : "release-commiter", 12 | "uri" : "https://artifactory/artifactory/api/security/permissions/release-commiter" 13 | }, { 14 | "name" : "read-docker", 15 | "uri" : "https://artifactory/artifactory/api/security/permissions/read-docker" 16 | } ] 17 | -------------------------------------------------------------------------------- /artifactory.v54/assets/test/permissions.json: -------------------------------------------------------------------------------- 1 | [ { 2 | "name" : "snapshot-write", 3 | "uri" : "https://artifactory/artifactory/api/security/permissions/snapshot-write" 4 | }, { 5 | "name" : "Any Remote", 6 | "uri" : "https://artifactory/artifactory/api/security/permissions/Any%20Remote" 7 | }, { 8 | "name" : "Anything", 9 | "uri" : "https://artifactory/artifactory/api/security/permissions/Anything" 10 | }, { 11 | "name" : "release-commiter", 12 | "uri" : "https://artifactory/artifactory/api/security/permissions/release-commiter" 13 | }, { 14 | "name" : "read-docker", 15 | "uri" : "https://artifactory/artifactory/api/security/permissions/read-docker" 16 | } ] 17 | -------------------------------------------------------------------------------- /src/artifactory.v401/assets/test/permissions.json: -------------------------------------------------------------------------------- 1 | [ { 2 | "name" : "snapshot-write", 3 | "uri" : "https://artifactory/artifactory/api/security/permissions/snapshot-write" 4 | }, { 5 | "name" : "Any Remote", 6 | "uri" : "https://artifactory/artifactory/api/security/permissions/Any%20Remote" 7 | }, { 8 | "name" : "Anything", 9 | "uri" : "https://artifactory/artifactory/api/security/permissions/Anything" 10 | }, { 11 | "name" : "release-commiter", 12 | "uri" : "https://artifactory/artifactory/api/security/permissions/release-commiter" 13 | }, { 14 | "name" : "read-docker", 15 | "uri" : "https://artifactory/artifactory/api/security/permissions/read-docker" 16 | } ] 17 | -------------------------------------------------------------------------------- /src/artifactory.v491/assets/test/permissions.json: -------------------------------------------------------------------------------- 1 | [ { 2 | "name" : "snapshot-write", 3 | "uri" : "https://artifactory/artifactory/api/security/permissions/snapshot-write" 4 | }, { 5 | "name" : "Any Remote", 6 | "uri" : "https://artifactory/artifactory/api/security/permissions/Any%20Remote" 7 | }, { 8 | "name" : "Anything", 9 | "uri" : "https://artifactory/artifactory/api/security/permissions/Anything" 10 | }, { 11 | "name" : "release-commiter", 12 | "uri" : "https://artifactory/artifactory/api/security/permissions/release-commiter" 13 | }, { 14 | "name" : "read-docker", 15 | "uri" : "https://artifactory/artifactory/api/security/permissions/read-docker" 16 | } ] 17 | -------------------------------------------------------------------------------- /artifactory.v54/assets/test/file_list.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "http://localhost:8081/artifactory/api/storage/libs-release-local/org/acme", 3 | "created": "ISO8601", 4 | "files": [ 5 | { 6 | "uri": "/archived", 7 | "size": -1, 8 | "lastModified": "ISO8601", 9 | "folder": true 10 | }, 11 | { 12 | "uri": "/doc.txt", 13 | "size": 253207, 14 | "lastModified": "ISO8601", 15 | "folder": false, 16 | "sha1": "sha1Checksum" 17 | }, 18 | { 19 | "uri": "/archived/doc1.txt", 20 | "size": 253100, 21 | "lastModified": "ISO8601", 22 | "folder": false, 23 | "sha1": "sha1Checksum" 24 | } 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /vendor/gopkg.in/alecthomas/kingpin.v2/_examples/chat1/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | 6 | "gopkg.in/alecthomas/kingpin.v2" 7 | ) 8 | 9 | var ( 10 | debug = kingpin.Flag("debug", "Enable debug mode.").Bool() 11 | timeout = kingpin.Flag("timeout", "Timeout waiting for ping.").Default("5s").OverrideDefaultFromEnvar("PING_TIMEOUT").Short('t').Duration() 12 | ip = kingpin.Arg("ip", "IP address to ping.").Required().IP() 13 | count = kingpin.Arg("count", "Number of packets to send").Int() 14 | ) 15 | 16 | func main() { 17 | kingpin.Version("0.0.1") 18 | kingpin.Parse() 19 | fmt.Printf("Would ping: %s with timeout %s and count %d", *ip, *timeout, *count) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/gopkg.in/alecthomas/kingpin.v2/_examples/ping/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | 6 | "gopkg.in/alecthomas/kingpin.v2" 7 | ) 8 | 9 | var ( 10 | debug = kingpin.Flag("debug", "Enable debug mode.").Bool() 11 | timeout = kingpin.Flag("timeout", "Timeout waiting for ping.").OverrideDefaultFromEnvar("PING_TIMEOUT").Required().Short('t').Duration() 12 | ip = kingpin.Arg("ip", "IP address to ping.").Required().IP() 13 | count = kingpin.Arg("count", "Number of packets to send").Int() 14 | ) 15 | 16 | func main() { 17 | kingpin.Version("0.0.1") 18 | kingpin.Parse() 19 | fmt.Printf("Would ping: %s with timeout %s and count %d", *ip, *timeout, *count) 20 | } 21 | -------------------------------------------------------------------------------- /artifactory.v54/assets/test/ha_license_information.json: -------------------------------------------------------------------------------- 1 | { 2 | "licenses": [ 3 | { 4 | "type" : "Enterprise", 5 | "validThrough" : "May 15, 2018", 6 | "licensedTo" : "JFrog", 7 | "licenseHash" : "179b7ea384d0c4655a00dfac7285a21d986a17923", 8 | "nodeId" : "art1", 9 | "nodeUrl" : "http://10.1.16.83:8091/artifactory", 10 | "expired" : false 11 | }, 12 | { 13 | "type" : "Enterprise", 14 | "validThrough" : "May 15, 2018", 15 | "licensedTo" : "JFrog", 16 | "licenseHash" : "e10b8aa1d1dc5107439ce43debc6e65dfeb71afd3", 17 | "nodeId" : "Not in use", 18 | "nodeUrl" : "Not in use", 19 | "expired" : false 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /cmd/artif-delete-user/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | artifactory "github.com/lusis/go-artifactory/artifactory.v54" 8 | kingpin "gopkg.in/alecthomas/kingpin.v2" 9 | ) 10 | 11 | var ( 12 | username = kingpin.Arg("username", "Username to delete").Required().String() 13 | ) 14 | 15 | func main() { 16 | kingpin.Parse() 17 | client, clientErr := artifactory.NewClientFromEnv() 18 | if clientErr != nil { 19 | fmt.Printf("%s\n", clientErr.Error()) 20 | os.Exit(1) 21 | } 22 | err := client.DeleteUser(*username) 23 | if err != nil { 24 | fmt.Printf("%s\n", err) 25 | os.Exit(1) 26 | } else { 27 | fmt.Printf("User %s deleted\n", *username) 28 | os.Exit(0) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /artifactory.v51/license.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | // LicenseInformation represents the json response from artifactory for license information 8 | type LicenseInformation struct { 9 | LicenseType string `json:"type"` 10 | ValidThrough string `json:"validThrough"` 11 | LicensedTo string `json:"licensedTo"` 12 | } 13 | 14 | // GetLicenseInformation returns license information from Artifactory 15 | func (c *Client) GetLicenseInformation() (LicenseInformation, error) { 16 | o := make(map[string]string) 17 | var l LicenseInformation 18 | d, e := c.Get("/api/system/license", o) 19 | if e != nil { 20 | return l, e 21 | } 22 | err := json.Unmarshal(d, &l) 23 | return l, err 24 | } 25 | -------------------------------------------------------------------------------- /src/artifactory.v401/storage.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | type CreatedStorageItem struct { 4 | URI string `json:"uri"` 5 | DownloadURI string `json:"downloadUri"` 6 | Repo string `json:"repo"` 7 | Created string `json:"created"` 8 | CreatedBy string `json:"createdBy"` 9 | Size string `json:"size"` 10 | MimeType string `json:"mimeType"` 11 | Checksums ArtifactChecksums `json:"checksums"` 12 | OriginalChecksums ArtifactChecksums `json:"originalChecksums"` 13 | } 14 | 15 | type ArtifactChecksums struct { 16 | MD5 string `json:"md5"` 17 | SHA1 string `json:"sha1"` 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/lusis/outputter/example/stdlib/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "log" 6 | 7 | outputter "github.com/lusis/outputter" 8 | ) 9 | 10 | var outputFormat = flag.String("format", "tabular", "format for output") 11 | 12 | func main() { 13 | flag.Parse() 14 | outputFormatter, err := outputter.NewOutputter(*outputFormat) 15 | if err != nil { 16 | log.Fatalf("unable to create an outputter: %s", err.Error()) 17 | } 18 | 19 | outputFormatter.SetHeaders([]string{"header1", "header2", "header3"}) 20 | rowErr := outputFormatter.AddRow([]string{"value1", "value2", "value3"}) 21 | if rowErr != nil { 22 | log.Fatalf("error adding row: %s", rowErr.Error()) 23 | } 24 | outputFormatter.Draw() 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/lusis/outputter/example/cobra/README.md: -------------------------------------------------------------------------------- 1 | # cobra examples 2 | 3 | In the cobra example, we make a persistent global flag to control the output 4 | We also needed to shove the output as a subcommand 5 | 6 | ## tabular 7 | 8 | `go run main.go` 9 | 10 | ```text 11 | header1 header2 header3 12 | value1 value2 value3 13 | ``` 14 | 15 | ## json 16 | 17 | `go run main.go --format json` 18 | 19 | ```text 20 | [{"header1":"value1","header2":"value2","header3":"value3"}] 21 | ``` 22 | 23 | ## table 24 | 25 | `go run main.go --format table` 26 | 27 | ```text 28 | +---------+---------+---------+ 29 | | HEADER1 | HEADER2 | HEADER3 | 30 | +---------+---------+---------+ 31 | | value1 | value2 | value3 | 32 | +---------+---------+---------+ 33 | ``` -------------------------------------------------------------------------------- /vendor/gopkg.in/alecthomas/kingpin.v2/_examples/modular/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | "gopkg.in/alecthomas/kingpin.v2" 8 | ) 9 | 10 | // Context for "ls" command 11 | type LsCommand struct { 12 | All bool 13 | } 14 | 15 | func (l *LsCommand) run(c *kingpin.ParseContext) error { 16 | fmt.Printf("all=%v\n", l.All) 17 | return nil 18 | } 19 | 20 | func configureLsCommand(app *kingpin.Application) { 21 | c := &LsCommand{} 22 | ls := app.Command("ls", "List files.").Action(c.run) 23 | ls.Flag("all", "List all files.").Short('a').BoolVar(&c.All) 24 | } 25 | 26 | func main() { 27 | app := kingpin.New("modular", "My modular application.") 28 | configureLsCommand(app) 29 | kingpin.MustParse(app.Parse(os.Args[1:])) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/lusis/outputter/example/color/README.md: -------------------------------------------------------------------------------- 1 | # colorized examples 2 | In general, you should be able to pass a color code to the output and things will print properly. 3 | 4 | However color makes no sense for json and there's a bug for tabwriter preventing it from working 5 | 6 | This example shows how to use `fatih/color`'s `NoColor` in conjunction. 7 | 8 | ## tabular 9 | 10 | `go run main.go` 11 | 12 | ```text 13 | header1 header2 header3 14 | value1 value2 value3 15 | ``` 16 | 17 | ## json 18 | 19 | `go run main.go --format json` 20 | 21 | ```text 22 | [{"header1":"value1","header2":"value2","header3":"value3"}] 23 | ``` 24 | 25 | ## table 26 | 27 | `go run main.go --format table` 28 | 29 | ![COLORZ!](color-table.png?raw=true) 30 | 31 | ```text 32 | 33 | ``` -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/cov_report.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This script uses gocov to generate a test coverage report. 4 | # The gocov tool my be obtained with the following command: 5 | # go get github.com/axw/gocov/gocov 6 | # 7 | # It will be installed to $GOPATH/bin, so ensure that location is in your $PATH. 8 | 9 | # Check for gocov. 10 | if ! type gocov >/dev/null 2>&1; then 11 | echo >&2 "This script requires the gocov tool." 12 | echo >&2 "You may obtain it with the following command:" 13 | echo >&2 "go get github.com/axw/gocov/gocov" 14 | exit 1 15 | fi 16 | 17 | # Only run the cgo tests if gcc is installed. 18 | if type gcc >/dev/null 2>&1; then 19 | (cd spew && gocov test -tags testcgo | gocov report) 20 | else 21 | (cd spew && gocov test | gocov report) 22 | fi 23 | -------------------------------------------------------------------------------- /vendor/github.com/alecthomas/units/si.go: -------------------------------------------------------------------------------- 1 | package units 2 | 3 | // SI units. 4 | type SI int64 5 | 6 | // SI unit multiples. 7 | const ( 8 | Kilo SI = 1000 9 | Mega = Kilo * 1000 10 | Giga = Mega * 1000 11 | Tera = Giga * 1000 12 | Peta = Tera * 1000 13 | Exa = Peta * 1000 14 | ) 15 | 16 | func MakeUnitMap(suffix, shortSuffix string, scale int64) map[string]float64 { 17 | return map[string]float64{ 18 | shortSuffix: 1, 19 | "K" + suffix: float64(scale), 20 | "M" + suffix: float64(scale * scale), 21 | "G" + suffix: float64(scale * scale * scale), 22 | "T" + suffix: float64(scale * scale * scale * scale), 23 | "P" + suffix: float64(scale * scale * scale * scale * scale), 24 | "E" + suffix: float64(scale * scale * scale * scale * scale * scale), 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2012-2016 Dave Collins 4 | 5 | Permission to use, copy, modify, and distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /vendor/github.com/lusis/outputter/example/kingpin/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | 6 | outputter "github.com/lusis/outputter" 7 | kingpin "gopkg.in/alecthomas/kingpin.v2" 8 | ) 9 | 10 | func main() { 11 | var outputFormat string 12 | kingpin.Flag("format", "format for output"). 13 | Default("tabular"). 14 | EnumVar(&outputFormat, outputter.GetOutputters()...) 15 | kingpin.Parse() 16 | outputFormatter, err := outputter.NewOutputter(outputFormat) 17 | if err != nil { 18 | log.Fatalf("unable to create an outputter: %s", err.Error()) 19 | } 20 | 21 | outputFormatter.SetHeaders([]string{"header1", "header2", "header3"}) 22 | rowErr := outputFormatter.AddRow([]string{"value1", "value2", "value3"}) 23 | if rowErr != nil { 24 | log.Fatalf("error adding row: %s", rowErr.Error()) 25 | } 26 | outputFormatter.Draw() 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-semver/README.md: -------------------------------------------------------------------------------- 1 | # go-semver - Semantic Versioning Library 2 | 3 | [![Build Status](https://travis-ci.org/coreos/go-semver.svg?branch=master)](https://travis-ci.org/coreos/go-semver) 4 | [![GoDoc](https://godoc.org/github.com/coreos/go-semver/semver?status.svg)](https://godoc.org/github.com/coreos/go-semver/semver) 5 | 6 | go-semver is a [semantic versioning][semver] library for Go. It lets you parse 7 | and compare two semantic version strings. 8 | 9 | [semver]: http://semver.org/ 10 | 11 | ## Usage 12 | 13 | ```go 14 | vA := semver.New("1.2.3") 15 | vB := semver.New("3.2.1") 16 | 17 | fmt.Printf("%s < %s == %t\n", vA, vB, vA.LessThan(*vB)) 18 | ``` 19 | 20 | ## Example Application 21 | 22 | ``` 23 | $ go run example.go 1.2.3 3.2.1 24 | 1.2.3 < 3.2.1 == true 25 | 26 | $ go run example.go 5.2.3 3.2.1 27 | 5.2.3 < 3.2.1 == false 28 | ``` 29 | -------------------------------------------------------------------------------- /artifactory.v54/assets/test/local_repository_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "key" : "libs-release-local", 3 | "rclass" : "local", 4 | "packageType" : "maven", 5 | "description" : "Local repository for in-house libraries", 6 | "notes" : "", 7 | "includesPattern" : "**/*", 8 | "excludesPattern" : "", 9 | "repoLayoutRef" : "maven-2-default", 10 | "handleReleases" : true, 11 | "handleSnapshots" : false, 12 | "maxUniqueSnapshots" : 0, 13 | "suppressPomConsistencyChecks" : true, 14 | "blackedOut" : false, 15 | "propertySets" : [ "artifactory" ], 16 | "debianTrivialLayout" : false, 17 | "checksumPolicyType" : "client-checksums", 18 | "maxUniqueTags" : 0, 19 | "snapshotVersionBehavior" : "unique", 20 | "archiveBrowsingEnabled" : false, 21 | "calculateYumMetadata" : false, 22 | "yumRootDepth" : 0, 23 | "dockerApiVersion" : "V1", 24 | "enableFileListsIndexing" : false 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/lusis/outputter/outputs_test.go: -------------------------------------------------------------------------------- 1 | package outputter 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/assert" 7 | ) 8 | 9 | func TestNewOutputterJSON(t *testing.T) { 10 | f, err := NewOutputter("json") 11 | assert.NoError(t, err) 12 | assert.IsType(t, &JSONOutput{}, f) 13 | } 14 | 15 | func TestGetDefaultOutputter(t *testing.T) { 16 | f := GetDefaultOutputter() 17 | assert.IsType(t, &TabularOutput{}, f) 18 | } 19 | 20 | func TestKnownOutputs(t *testing.T) { 21 | f := GetOutputters() 22 | assert.NotEmpty(t, f) 23 | assert.Len(t, f, 5) 24 | } 25 | 26 | func TestUnknownOutputter(t *testing.T) { 27 | _, err := NewOutputter("test") 28 | assert.Equal(t, err, ErrorUnknownOutputter) 29 | } 30 | 31 | func TestNewKnownOutputters(t *testing.T) { 32 | for _, x := range GetOutputters() { 33 | _, err := NewOutputter(x) 34 | assert.NoError(t, err) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/lusis/outputter/tabular_output_test.go: -------------------------------------------------------------------------------- 1 | package outputter 2 | 3 | import ( 4 | "bytes" 5 | "testing" 6 | 7 | "github.com/stretchr/testify/assert" 8 | ) 9 | 10 | func TestNewTabularOutput(t *testing.T) { 11 | table := NewTabularOutput() 12 | assert.IsType(t, new(TabularOutput), table) 13 | } 14 | 15 | func TestTabularOutputNew(t *testing.T) { 16 | var buf bytes.Buffer 17 | table := NewTabularOutputWithWriter(&buf) 18 | table.SetHeaders([]string{"header1", "header2"}) 19 | r1Err := table.AddRow([]string{"value1aaaaaaaaaaaaa", "value2bbbbbbbbbbbbbbbbbb"}) 20 | r2Err := table.AddRow([]string{"value3", "value4"}) 21 | assert.NoError(t, r1Err) 22 | assert.NoError(t, r2Err) 23 | table.Draw() 24 | expectedOutput := "header1 header2\nvalue1aaaaaaaaaaaaa value2bbbbbbbbbbbbbbbbbb\nvalue3 value4\n" 25 | assert.Equal(t, expectedOutput, buf.String()) 26 | } 27 | -------------------------------------------------------------------------------- /artifactory.v51/assets/test/virtual_repository_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "key" : "libs-release", 3 | "packageType" : "maven", 4 | "description" : "", 5 | "notes" : "", 6 | "includesPattern" : "**/*", 7 | "excludesPattern" : "", 8 | "enableNuGetSupport" : false, 9 | "enableGemsSupport" : false, 10 | "enableNpmSupport" : false, 11 | "enableBowerSupport" : false, 12 | "enableDebianSupport" : false, 13 | "debianTrivialLayout" : false, 14 | "enablePypiSupport" : false, 15 | "enableDockerSupport" : false, 16 | "dockerApiVersion" : "V1", 17 | "forceDockerAuthentication" : false, 18 | "enableVagrantSupport" : false, 19 | "enableGitLfsSupport" : false, 20 | "repositories" : [ "libs-release-local", "ext-release-local", "remote-repos" ], 21 | "artifactoryRequestsCanRetrieveRemoteArtifacts" : false, 22 | "keyPair" : "", 23 | "pomRepositoryReferencesCleanupPolicy" : "discard_active_reference", 24 | "rclass" : "virtual" 25 | } 26 | -------------------------------------------------------------------------------- /vendor/gopkg.in/alecthomas/kingpin.v2/guesswidth_unix.go: -------------------------------------------------------------------------------- 1 | // +build !appengine,linux freebsd darwin dragonfly netbsd openbsd 2 | 3 | package kingpin 4 | 5 | import ( 6 | "io" 7 | "os" 8 | "strconv" 9 | "syscall" 10 | "unsafe" 11 | ) 12 | 13 | func guessWidth(w io.Writer) int { 14 | // check if COLUMNS env is set to comply with 15 | // http://pubs.opengroup.org/onlinepubs/009604499/basedefs/xbd_chap08.html 16 | colsStr := os.Getenv("COLUMNS") 17 | if colsStr != "" { 18 | if cols, err := strconv.Atoi(colsStr); err == nil { 19 | return cols 20 | } 21 | } 22 | 23 | if t, ok := w.(*os.File); ok { 24 | fd := t.Fd() 25 | var dimensions [4]uint16 26 | 27 | if _, _, err := syscall.Syscall6( 28 | syscall.SYS_IOCTL, 29 | uintptr(fd), 30 | uintptr(syscall.TIOCGWINSZ), 31 | uintptr(unsafe.Pointer(&dimensions)), 32 | 0, 0, 0, 33 | ); err == 0 { 34 | return int(dimensions[1]) 35 | } 36 | } 37 | return 80 38 | } 39 | -------------------------------------------------------------------------------- /src/artifactory.v401/assets/test/virtual_repository_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "key" : "libs-release", 3 | "packageType" : "maven", 4 | "description" : "", 5 | "notes" : "", 6 | "includesPattern" : "**/*", 7 | "excludesPattern" : "", 8 | "enableNuGetSupport" : false, 9 | "enableGemsSupport" : false, 10 | "enableNpmSupport" : false, 11 | "enableBowerSupport" : false, 12 | "enableDebianSupport" : false, 13 | "debianTrivialLayout" : false, 14 | "enablePypiSupport" : false, 15 | "enableDockerSupport" : false, 16 | "dockerApiVersion" : "V1", 17 | "forceDockerAuthentication" : false, 18 | "enableVagrantSupport" : false, 19 | "enableGitLfsSupport" : false, 20 | "repositories" : [ "libs-release-local", "ext-release-local", "remote-repos" ], 21 | "artifactoryRequestsCanRetrieveRemoteArtifacts" : false, 22 | "keyPair" : "", 23 | "pomRepositoryReferencesCleanupPolicy" : "discard_active_reference", 24 | "rclass" : "virtual" 25 | } 26 | -------------------------------------------------------------------------------- /src/artifactory.v491/assets/test/virtual_repository_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "key" : "libs-release", 3 | "packageType" : "maven", 4 | "description" : "", 5 | "notes" : "", 6 | "includesPattern" : "**/*", 7 | "excludesPattern" : "", 8 | "enableNuGetSupport" : false, 9 | "enableGemsSupport" : false, 10 | "enableNpmSupport" : false, 11 | "enableBowerSupport" : false, 12 | "enableDebianSupport" : false, 13 | "debianTrivialLayout" : false, 14 | "enablePypiSupport" : false, 15 | "enableDockerSupport" : false, 16 | "dockerApiVersion" : "V1", 17 | "forceDockerAuthentication" : false, 18 | "enableVagrantSupport" : false, 19 | "enableGitLfsSupport" : false, 20 | "repositories" : [ "libs-release-local", "ext-release-local", "remote-repos" ], 21 | "artifactoryRequestsCanRetrieveRemoteArtifacts" : false, 22 | "keyPair" : "", 23 | "pomRepositoryReferencesCleanupPolicy" : "discard_active_reference", 24 | "rclass" : "virtual" 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/README.mkd: -------------------------------------------------------------------------------- 1 | go-runewidth 2 | ============ 3 | 4 | [![Build Status](https://travis-ci.org/mattn/go-runewidth.png?branch=master)](https://travis-ci.org/mattn/go-runewidth) 5 | [![Coverage Status](https://coveralls.io/repos/mattn/go-runewidth/badge.png?branch=HEAD)](https://coveralls.io/r/mattn/go-runewidth?branch=HEAD) 6 | [![GoDoc](https://godoc.org/github.com/mattn/go-runewidth?status.svg)](http://godoc.org/github.com/mattn/go-runewidth) 7 | [![Go Report Card](https://goreportcard.com/badge/github.com/mattn/go-runewidth)](https://goreportcard.com/report/github.com/mattn/go-runewidth) 8 | 9 | Provides functions to get fixed width of the character or string. 10 | 11 | Usage 12 | ----- 13 | 14 | ```go 15 | runewidth.StringWidth("つのだ☆HIRO") == 12 16 | ``` 17 | 18 | 19 | Author 20 | ------ 21 | 22 | Yasuhiro Matsumoto 23 | 24 | License 25 | ------- 26 | 27 | under the MIT License: http://mattn.mit-license.org/2013 28 | -------------------------------------------------------------------------------- /cmd/artif-list-groups/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | artifactory "github.com/lusis/go-artifactory/artifactory.v54" 8 | "github.com/lusis/outputter" 9 | kingpin "gopkg.in/alecthomas/kingpin.v2" 10 | ) 11 | 12 | var ( 13 | format = kingpin.Flag("format", "format to display output"). 14 | Default("table"). 15 | Enum(outputter.GetOutputters()...) 16 | ) 17 | 18 | func main() { 19 | kingpin.Parse() 20 | client, clientErr := artifactory.NewClientFromEnv() 21 | if clientErr != nil { 22 | fmt.Printf("%s\n", clientErr.Error()) 23 | os.Exit(1) 24 | } 25 | output, _ := outputter.NewOutputter(*format) 26 | data, err := client.GetGroups() 27 | if err != nil { 28 | fmt.Printf("%s\n", err) 29 | os.Exit(1) 30 | } else { 31 | output.SetHeaders([]string{"Name", "Uri"}) 32 | for _, u := range data { 33 | _ = output.AddRow([]string{u.Name, u.URI}) 34 | } 35 | output.Draw() 36 | os.Exit(0) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /cmd/artif-get-license/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | artifactory "github.com/lusis/go-artifactory/artifactory.v54" 8 | "github.com/lusis/outputter" 9 | kingpin "gopkg.in/alecthomas/kingpin.v2" 10 | ) 11 | 12 | var ( 13 | format = kingpin.Flag("format", "format to display output"). 14 | Default("table"). 15 | Enum("table", "json", "tabular") 16 | ) 17 | 18 | func main() { 19 | kingpin.Parse() 20 | output, _ := outputter.NewOutputter(*format) 21 | client, clientErr := artifactory.NewClientFromEnv() 22 | if clientErr != nil { 23 | fmt.Printf("%s\n", clientErr.Error()) 24 | os.Exit(1) 25 | } 26 | data, err := client.GetLicenseInfo() 27 | if err != nil { 28 | fmt.Printf("%s\n", err) 29 | os.Exit(1) 30 | } else { 31 | output.SetHeaders([]string{"Type", "Expires", "Owner"}) 32 | _ = output.AddRow([]string{data.LicenseType, data.ValidThrough, data.LicensedTo}) 33 | output.Draw() 34 | os.Exit(0) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /cmd/artif-list-permission-targets/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | artifactory "github.com/lusis/go-artifactory/artifactory.v54" 8 | "github.com/lusis/outputter" 9 | kingpin "gopkg.in/alecthomas/kingpin.v2" 10 | ) 11 | 12 | var ( 13 | format = kingpin.Flag("format", "format to display output"). 14 | Default("table"). 15 | Enum(outputter.GetOutputters()...) 16 | ) 17 | 18 | func main() { 19 | kingpin.Parse() 20 | client, clientErr := artifactory.NewClientFromEnv() 21 | if clientErr != nil { 22 | fmt.Printf("%s\n", clientErr.Error()) 23 | os.Exit(1) 24 | } 25 | output, _ := outputter.NewOutputter(*format) 26 | data, err := client.GetPermissionTargets() 27 | if err != nil { 28 | fmt.Printf("%s\n", err) 29 | os.Exit(1) 30 | } else { 31 | output.SetHeaders([]string{"Name", "Uri"}) 32 | for _, u := range data { 33 | _ = output.AddRow([]string{u.Name, u.URI}) 34 | } 35 | output.Draw() 36 | os.Exit(0) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/suite/interfaces.go: -------------------------------------------------------------------------------- 1 | package suite 2 | 3 | import "testing" 4 | 5 | // TestingSuite can store and return the current *testing.T context 6 | // generated by 'go test'. 7 | type TestingSuite interface { 8 | T() *testing.T 9 | SetT(*testing.T) 10 | } 11 | 12 | // SetupAllSuite has a SetupSuite method, which will run before the 13 | // tests in the suite are run. 14 | type SetupAllSuite interface { 15 | SetupSuite() 16 | } 17 | 18 | // SetupTestSuite has a SetupTest method, which will run before each 19 | // test in the suite. 20 | type SetupTestSuite interface { 21 | SetupTest() 22 | } 23 | 24 | // TearDownAllSuite has a TearDownSuite method, which will run after 25 | // all the tests in the suite have been run. 26 | type TearDownAllSuite interface { 27 | TearDownSuite() 28 | } 29 | 30 | // TearDownTestSuite has a TearDownTest method, which will run after 31 | // each test in the suite. 32 | type TearDownTestSuite interface { 33 | TearDownTest() 34 | } 35 | -------------------------------------------------------------------------------- /Gopkg.toml: -------------------------------------------------------------------------------- 1 | 2 | # Gopkg.toml example 3 | # 4 | # Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md 5 | # for detailed Gopkg.toml documentation. 6 | # 7 | # required = ["github.com/user/thing/cmd/thing"] 8 | # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] 9 | # 10 | # [[constraint]] 11 | # name = "github.com/user/project" 12 | # version = "1.0.0" 13 | # 14 | # [[constraint]] 15 | # name = "github.com/user/project2" 16 | # branch = "dev" 17 | # source = "github.com/myfork/project2" 18 | # 19 | # [[override]] 20 | # name = "github.com/x/y" 21 | # version = "2.4.0" 22 | 23 | 24 | [[constraint]] 25 | name = "github.com/coreos/go-semver" 26 | version = "0.2.0" 27 | 28 | [[constraint]] 29 | branch = "master" 30 | name = "github.com/lusis/outputter" 31 | 32 | [[constraint]] 33 | name = "github.com/stretchr/testify" 34 | version = "1.1.4" 35 | 36 | [[constraint]] 37 | name = "gopkg.in/alecthomas/kingpin.v2" 38 | version = "2.2.5" 39 | -------------------------------------------------------------------------------- /artifactory.v54/api.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | import "encoding/json" 4 | 5 | // UserAPIKey represents the JSON returned for a user's API Key in Artifactory 6 | type UserAPIKey struct { 7 | APIKey string `json:"apiKey"` 8 | } 9 | 10 | // GetUserAPIKey returns the current user's api key 11 | func (c *Client) GetUserAPIKey() (string, error) { 12 | var res UserAPIKey 13 | d, err := c.Get("/api/security/apiKey", make(map[string]string)) 14 | if err != nil { 15 | return "", err 16 | } 17 | err = json.Unmarshal(d, &res) 18 | if err != nil { 19 | return "", err 20 | } 21 | return res.APIKey, nil 22 | } 23 | 24 | // CreateUserAPIKey creates an apikey for the current user 25 | func (c *Client) CreateUserAPIKey() (string, error) { 26 | var res UserAPIKey 27 | d, err := c.Post("/api/security/apiKey", nil, make(map[string]string)) 28 | if err != nil { 29 | return "", err 30 | } 31 | err = json.Unmarshal(d, &res) 32 | if err != nil { 33 | return "", err 34 | } 35 | return res.APIKey, nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/doc.go: -------------------------------------------------------------------------------- 1 | // Package require implements the same assertions as the `assert` package but 2 | // stops test execution when a test fails. 3 | // 4 | // Example Usage 5 | // 6 | // The following is a complete example using require in a standard test function: 7 | // import ( 8 | // "testing" 9 | // "github.com/stretchr/testify/require" 10 | // ) 11 | // 12 | // func TestSomething(t *testing.T) { 13 | // 14 | // var a string = "Hello" 15 | // var b string = "Hello" 16 | // 17 | // require.Equal(t, a, b, "The two words should be the same.") 18 | // 19 | // } 20 | // 21 | // Assertions 22 | // 23 | // The `require` package have same global functions as in the `assert` package, 24 | // but instead of returning a boolean result they call `t.FailNow()`. 25 | // 26 | // Every assertion function also takes an optional string message as the final argument, 27 | // allowing custom error messages to be appended to the message the assertion method outputs. 28 | package require 29 | -------------------------------------------------------------------------------- /src/artifactory.v401/mimetypes.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | const LOCAL_REPO_MIMETYPE string = "application/vnd.org.jfrog.artifactory.repositories.LocalRepositoryConfiguration+json" 4 | const REMOTE_REPO_MIMETYPE string = "application/vnd.org.jfrog.artifactory.repositories.RemoteRepositoryConfiguration+json" 5 | const VIRTUAL_REPO_MIMETYPE string = "application/vnd.org.jfrog.artifactory.repositories.VirtualRepositoryConfiguration+json" 6 | const USER_MIMETYPE string = "application/vnd.org.jfrog.artifactory.security.User+json" 7 | const GROUP_MIMETYPE string = "application/vnd.org.jfrog.artifactory.security.Group+json" 8 | const PERMISSION_TARGET_MIMETYPE string = "application/vnd.org.jfrog.artifactory.security.PermissionTarget+json" 9 | const IMPORT_SETTINGS_MIMETYPE string = "application/vnd.org.jfrog.artifactory.system.ImportSettings+json" 10 | const EXPORT_SETTIGNS_MIMETYPE string = "application/vnd.org.jfrog.artifactory.system.ExportSettings+json" 11 | const SYSTEM_VERSION_MIMETYPE string = "application/vnd.org.jfrog.artifactory.system.Version+json" 12 | -------------------------------------------------------------------------------- /src/artifactory.v491/mimetypes.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | const LOCAL_REPO_MIMETYPE string = "application/vnd.org.jfrog.artifactory.repositories.LocalRepositoryConfiguration+json" 4 | const REMOTE_REPO_MIMETYPE string = "application/vnd.org.jfrog.artifactory.repositories.RemoteRepositoryConfiguration+json" 5 | const VIRTUAL_REPO_MIMETYPE string = "application/vnd.org.jfrog.artifactory.repositories.VirtualRepositoryConfiguration+json" 6 | const USER_MIMETYPE string = "application/vnd.org.jfrog.artifactory.security.User+json" 7 | const GROUP_MIMETYPE string = "application/vnd.org.jfrog.artifactory.security.Group+json" 8 | const PERMISSION_TARGET_MIMETYPE string = "application/vnd.org.jfrog.artifactory.security.PermissionTarget+json" 9 | const IMPORT_SETTINGS_MIMETYPE string = "application/vnd.org.jfrog.artifactory.system.ImportSettings+json" 10 | const EXPORT_SETTIGNS_MIMETYPE string = "application/vnd.org.jfrog.artifactory.system.ExportSettings+json" 11 | const SYSTEM_VERSION_MIMETYPE string = "application/vnd.org.jfrog.artifactory.system.Version+json" 12 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/doc.go: -------------------------------------------------------------------------------- 1 | // Package testify is a set of packages that provide many tools for testifying that your code will behave as you intend. 2 | // 3 | // testify contains the following packages: 4 | // 5 | // The assert package provides a comprehensive set of assertion functions that tie in to the Go testing system. 6 | // 7 | // The http package contains tools to make it easier to test http activity using the Go testing system. 8 | // 9 | // The mock package provides a system by which it is possible to mock your objects and verify calls are happening as expected. 10 | // 11 | // The suite package provides a basic structure for using structs as testing suites, and methods on those structs as tests. It includes setup/teardown functionality in the way of interfaces. 12 | package testify 13 | 14 | // blank imports help docs. 15 | import ( 16 | // assert package 17 | _ "github.com/stretchr/testify/assert" 18 | // http package 19 | _ "github.com/stretchr/testify/http" 20 | // mock package 21 | _ "github.com/stretchr/testify/mock" 22 | ) 23 | -------------------------------------------------------------------------------- /vendor/github.com/olekukonko/tablewriter/csv2table/README.md: -------------------------------------------------------------------------------- 1 | ASCII Table Writer Tool 2 | ========= 3 | 4 | Generate ASCII table on the fly via command line ... Installation is simple as 5 | 6 | #### Get Tool 7 | 8 | go get github.com/olekukonko/tablewriter/csv2table 9 | 10 | #### Install Tool 11 | 12 | go install github.com/olekukonko/tablewriter/csv2table 13 | 14 | 15 | #### Usage 16 | 17 | csv2table -f test.csv 18 | 19 | #### Support for Piping 20 | 21 | cat test.csv | csv2table -p=true 22 | 23 | #### Output 24 | 25 | ``` 26 | +------------+-----------+---------+ 27 | | FIRST NAME | LAST NAME | SSN | 28 | +------------+-----------+---------+ 29 | | John | Barry | 123456 | 30 | | Kathy | Smith | 687987 | 31 | | Bob | McCornick | 3979870 | 32 | +------------+-----------+---------+ 33 | ``` 34 | 35 | #### Another Piping with Header set to `false` 36 | 37 | echo dance,with,me | csv2table -p=true -h=false 38 | 39 | #### Output 40 | 41 | +-------+------+-----+ 42 | | dance | with | me | 43 | +-------+------+-----+ 44 | -------------------------------------------------------------------------------- /vendor/gopkg.in/alecthomas/kingpin.v2/completions.go: -------------------------------------------------------------------------------- 1 | package kingpin 2 | 3 | // HintAction is a function type who is expected to return a slice of possible 4 | // command line arguments. 5 | type HintAction func() []string 6 | type completionsMixin struct { 7 | hintActions []HintAction 8 | builtinHintActions []HintAction 9 | } 10 | 11 | func (a *completionsMixin) addHintAction(action HintAction) { 12 | a.hintActions = append(a.hintActions, action) 13 | } 14 | 15 | // Allow adding of HintActions which are added internally, ie, EnumVar 16 | func (a *completionsMixin) addHintActionBuiltin(action HintAction) { 17 | a.builtinHintActions = append(a.builtinHintActions, action) 18 | } 19 | 20 | func (a *completionsMixin) resolveCompletions() []string { 21 | var hints []string 22 | 23 | options := a.builtinHintActions 24 | if len(a.hintActions) > 0 { 25 | // User specified their own hintActions. Use those instead. 26 | options = a.hintActions 27 | } 28 | 29 | for _, hintAction := range options { 30 | hints = append(hints, hintAction()...) 31 | } 32 | return hints 33 | } 34 | -------------------------------------------------------------------------------- /cmd/artif-deploy-artifact/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | kingpin "gopkg.in/alecthomas/kingpin.v2" 8 | 9 | artifactory "github.com/lusis/go-artifactory/artifactory.v54" 10 | ) 11 | 12 | var ( 13 | repo = kingpin.Arg("repo", "repository key for upload").Required().String() 14 | file = kingpin.Arg("filename", "file to upload").Required().ExistingFile() 15 | path = kingpin.Arg("path", "path for deployed file").String() 16 | property = kingpin.Flag("property", "properties for the upload").StringMap() 17 | silent = kingpin.Flag("silent", "supress output").Bool() 18 | ) 19 | 20 | func main() { 21 | kingpin.Parse() 22 | client, clientErr := artifactory.NewClientFromEnv() 23 | if clientErr != nil { 24 | fmt.Printf("%s\n", clientErr.Error()) 25 | os.Exit(1) 26 | } 27 | 28 | i, err := client.DeployArtifact(*repo, *file, *path, *property) 29 | if err != nil { 30 | if !*silent { 31 | fmt.Printf("%s\n", err) 32 | } 33 | os.Exit(1) 34 | } else { 35 | if !*silent { 36 | fmt.Printf("%s\n", i.URI) 37 | } 38 | os.Exit(0) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/artifactory.v401/client_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | import ( 4 | "fmt" 5 | "github.com/stretchr/testify/assert" 6 | _ "io/ioutil" 7 | "net/http" 8 | "net/http/httptest" 9 | "net/url" 10 | _ "os" 11 | "testing" 12 | ) 13 | 14 | func TestNewClientCustomTransport(t *testing.T) { 15 | server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 16 | w.WriteHeader(200) 17 | w.Header().Set("Content-Type", "application/json") 18 | fmt.Fprint(w, "pong") 19 | })) 20 | transport := &http.Transport{ 21 | Proxy: func(req *http.Request) (*url.URL, error) { 22 | return url.Parse(server.URL) 23 | }, 24 | } 25 | defer server.Close() 26 | conf := &ClientConfig{ 27 | BaseURL: "http://127.0.0.1:8080/", 28 | Username: "username", 29 | Password: "password", 30 | VerifySSL: false, 31 | Transport: transport, 32 | } 33 | 34 | client := NewClient(conf) 35 | res, err := client.Get("/ping", make(map[string]string)) 36 | assert.Nil(t, err, "should not return an error") 37 | assert.Equal(t, "pong", string(res), "should return the testmsg") 38 | } 39 | -------------------------------------------------------------------------------- /src/artifactory.v491/client_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | import ( 4 | "fmt" 5 | "github.com/stretchr/testify/assert" 6 | _ "io/ioutil" 7 | "net/http" 8 | "net/http/httptest" 9 | "net/url" 10 | _ "os" 11 | "testing" 12 | ) 13 | 14 | func TestNewClientCustomTransport(t *testing.T) { 15 | server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 16 | w.WriteHeader(200) 17 | w.Header().Set("Content-Type", "application/json") 18 | fmt.Fprint(w, "pong") 19 | })) 20 | transport := &http.Transport{ 21 | Proxy: func(req *http.Request) (*url.URL, error) { 22 | return url.Parse(server.URL) 23 | }, 24 | } 25 | defer server.Close() 26 | conf := &ClientConfig{ 27 | BaseURL: "http://127.0.0.1:8080/", 28 | Username: "username", 29 | Password: "password", 30 | VerifySSL: false, 31 | Transport: transport, 32 | } 33 | 34 | client := NewClient(conf) 35 | res, err := client.Get("/ping", make(map[string]string)) 36 | assert.Nil(t, err, "should not return an error") 37 | assert.Equal(t, "pong", string(res), "should return the testmsg") 38 | } 39 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | BINARIES := $(shell find cmd/ -maxdepth 1 -type d -name 'artif-*' -exec sh -c 'echo $(basename {})' \;) 2 | BINLIST := $(subst cmd/,,$(BINARIES)) 3 | 4 | ifeq ($(TRAVIS_BUILD_DIR),) 5 | GOPATH := $(GOPATH) 6 | else 7 | GOPATH := $(GOPATH):$(TRAVIS_BUILD_DIR) 8 | endif 9 | 10 | all: clean lint test artifactory $(BINLIST) 11 | 12 | linux: export GOOS=linux 13 | linux: all linux-zip 14 | 15 | osx: export GOOS=darwin 16 | osx: clean artifactory $(BINLIST) osx-zip 17 | 18 | lint: 19 | @script/lint 20 | 21 | test: 22 | @script/test 23 | 24 | artifactory: 25 | @echo "Building for $(GOOS)" 26 | @script/build 27 | 28 | $(BINLIST): 29 | @echo $@ 30 | @go build -o bin/$@ ./cmd/$@ 31 | 32 | osx-zip: 33 | @mkdir target || echo "directory already exists" 34 | @zip -j target/artifactory-tools-osx-`date +%s`.zip bin/darwin_amd64/* 35 | 36 | linux-zip: 37 | @mkdir target || echo "directory already exists" 38 | @zip -j target/artifactory-tools-linux-`date +%s`.zip bin/* 39 | 40 | 41 | clean: 42 | @rm -rf bin/ pkg/ 43 | 44 | .PHONY: all clean lint test artifactory osx-zip linux-zip osx linux $(BINLIST) 45 | -------------------------------------------------------------------------------- /vendor/gopkg.in/alecthomas/kingpin.v2/envar.go: -------------------------------------------------------------------------------- 1 | package kingpin 2 | 3 | import ( 4 | "os" 5 | "regexp" 6 | ) 7 | 8 | var ( 9 | envVarValuesSeparator = "\r?\n" 10 | envVarValuesTrimmer = regexp.MustCompile(envVarValuesSeparator + "$") 11 | envVarValuesSplitter = regexp.MustCompile(envVarValuesSeparator) 12 | ) 13 | 14 | type envarMixin struct { 15 | envar string 16 | noEnvar bool 17 | } 18 | 19 | func (e *envarMixin) HasEnvarValue() bool { 20 | return e.GetEnvarValue() != "" 21 | } 22 | 23 | func (e *envarMixin) GetEnvarValue() string { 24 | if e.noEnvar || e.envar == "" { 25 | return "" 26 | } 27 | return os.Getenv(e.envar) 28 | } 29 | 30 | func (e *envarMixin) GetSplitEnvarValue() []string { 31 | values := make([]string, 0) 32 | 33 | envarValue := e.GetEnvarValue() 34 | if envarValue == "" { 35 | return values 36 | } 37 | 38 | // Split by new line to extract multiple values, if any. 39 | trimmed := envVarValuesTrimmer.ReplaceAllString(envarValue, "") 40 | for _, value := range envVarValuesSplitter.Split(trimmed, -1) { 41 | values = append(values, value) 42 | } 43 | 44 | return values 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/lusis/outputter/Gopkg.toml: -------------------------------------------------------------------------------- 1 | 2 | # Gopkg.toml example 3 | # 4 | # Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md 5 | # for detailed Gopkg.toml documentation. 6 | # 7 | # required = ["github.com/user/thing/cmd/thing"] 8 | # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] 9 | # 10 | # [[constraint]] 11 | # name = "github.com/user/project" 12 | # version = "1.0.0" 13 | # 14 | # [[constraint]] 15 | # name = "github.com/user/project2" 16 | # branch = "dev" 17 | # source = "github.com/myfork/project2" 18 | # 19 | # [[override]] 20 | # name = "github.com/x/y" 21 | # version = "2.4.0" 22 | 23 | 24 | [[constraint]] 25 | name = "github.com/fatih/color" 26 | version = "1.5.0" 27 | 28 | [[constraint]] 29 | branch = "master" 30 | name = "github.com/olekukonko/tablewriter" 31 | 32 | [[constraint]] 33 | name = "github.com/spf13/cobra" 34 | version = "0.0.1" 35 | 36 | [[constraint]] 37 | name = "github.com/stretchr/testify" 38 | version = "1.1.4" 39 | 40 | [[constraint]] 41 | name = "gopkg.in/alecthomas/kingpin.v2" 42 | version = "2.2.5" 43 | -------------------------------------------------------------------------------- /src/artifactory.v401/search.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | import ( 4 | "encoding/json" 5 | "strings" 6 | ) 7 | 8 | type Gavc struct { 9 | GroupID string 10 | ArtifactID string 11 | Version string 12 | Classifier string 13 | Repos []string 14 | } 15 | 16 | func (c *ArtifactoryClient) GAVCSearch(coords *Gavc) (files []FileInfo, e error) { 17 | url := "/api/search/gavc" 18 | params := make(map[string]string) 19 | if &coords.GroupID != nil { 20 | params["g"] = coords.GroupID 21 | } 22 | if &coords.ArtifactID != nil { 23 | params["a"] = coords.ArtifactID 24 | } 25 | if &coords.Version != nil { 26 | params["v"] = coords.Version 27 | } 28 | if &coords.Classifier != nil { 29 | params["c"] = coords.Classifier 30 | } 31 | if &coords.Repos != nil { 32 | params["repos"] = strings.Join(coords.Repos, ",") 33 | } 34 | d, err := c.Get(url, params) 35 | if err != nil { 36 | return files, err 37 | } else { 38 | var dat GavcSearchResults 39 | err := json.Unmarshal(d, &dat) 40 | if err != nil { 41 | return files, err 42 | } else { 43 | files = dat.Results 44 | return files, nil 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/lusis/outputter/example/color/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "log" 6 | 7 | color "github.com/fatih/color" 8 | outputter "github.com/lusis/outputter" 9 | ) 10 | 11 | var outputFormat = flag.String("format", "tabular", "format for output") 12 | 13 | func main() { 14 | flag.Parse() 15 | 16 | outputFormatter, err := outputter.NewOutputter(*outputFormat) 17 | if err != nil { 18 | log.Fatalf("unable to create an outputter: %s", err.Error()) 19 | } 20 | 21 | // set color output based on if the outputter supports it 22 | // not that `ColorSupport()` returns false if not supported 23 | // so inverse will need to be passed to `color.NoColor` 24 | color.NoColor = !outputFormatter.ColorSupport() 25 | outputFormatter.SetHeaders([]string{ 26 | "header1", 27 | "header2", 28 | "header3", 29 | }) 30 | rowErr := outputFormatter.AddRow([]string{ 31 | color.YellowString("value1"), 32 | color.YellowString("value2"), 33 | color.YellowString("value3"), 34 | }) 35 | if rowErr != nil { 36 | log.Fatalf("error adding row: %s", rowErr.Error()) 37 | } 38 | 39 | outputFormatter.Draw() 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/lusis/outputter/csv_output_test.go: -------------------------------------------------------------------------------- 1 | package outputter 2 | 3 | import ( 4 | "bufio" 5 | "bytes" 6 | "testing" 7 | 8 | "github.com/stretchr/testify/assert" 9 | ) 10 | 11 | func TestNewCSVOutput(t *testing.T) { 12 | j := NewCSVOutput() 13 | assert.IsType(t, NewCSVOutput(), j) 14 | } 15 | 16 | func TestCSVOutputSingleRow(t *testing.T) { 17 | var buf bytes.Buffer 18 | output := bufio.NewWriter(&buf) 19 | csv := NewCSVOutputWithWriter(output) 20 | csv.SetHeaders([]string{"key1", "key2"}) 21 | err := csv.AddRow([]string{"value1", "value2"}) 22 | assert.NoError(t, err) 23 | csv.Draw() 24 | _ = output.Flush() 25 | assert.Equal(t, "key1,key2\nvalue1,value2\n", buf.String()) 26 | } 27 | 28 | func TestCSVOutputMultipleRows(t *testing.T) { 29 | var buf bytes.Buffer 30 | csv := NewCSVOutputWithWriter(&buf) 31 | csv.SetHeaders([]string{"key1", "key2"}) 32 | r1Err := csv.AddRow([]string{"value1", "value2"}) 33 | r2Err := csv.AddRow([]string{"value3", "value4"}) 34 | assert.NoError(t, r1Err) 35 | assert.NoError(t, r2Err) 36 | csv.Draw() 37 | assert.Equal(t, "key1,key2\nvalue1,value2\nvalue3,value4\n", buf.String()) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-semver/semver/sort.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013-2015 CoreOS, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package semver 16 | 17 | import ( 18 | "sort" 19 | ) 20 | 21 | type Versions []*Version 22 | 23 | func (s Versions) Len() int { 24 | return len(s) 25 | } 26 | 27 | func (s Versions) Swap(i, j int) { 28 | s[i], s[j] = s[j], s[i] 29 | } 30 | 31 | func (s Versions) Less(i, j int) bool { 32 | return s[i].LessThan(*s[j]) 33 | } 34 | 35 | // Sort sorts the given slice of Version 36 | func Sort(versions []*Version) { 37 | sort.Sort(Versions(versions)) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/alecthomas/units/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (C) 2014 Alec Thomas 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /cmd/artif-list-files/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | artifactory "github.com/lusis/go-artifactory/artifactory.v54" 8 | "github.com/lusis/outputter" 9 | kingpin "gopkg.in/alecthomas/kingpin.v2" 10 | ) 11 | 12 | var ( 13 | format = kingpin.Flag("format", "format to display output"). 14 | Default("table"). 15 | Enum(outputter.GetOutputters()...) 16 | repo = kingpin.Arg("repo", "repo to list files").Required().String() 17 | path = kingpin.Arg("path", "path to list files").Default("/").String() 18 | ) 19 | 20 | func main() { 21 | kingpin.Parse() 22 | output, _ := outputter.NewOutputter(*format) 23 | client, clientErr := artifactory.NewClientFromEnv() 24 | if clientErr != nil { 25 | fmt.Printf("%s\n", clientErr.Error()) 26 | os.Exit(1) 27 | } 28 | u, err := client.GetFileList(*repo, *path) 29 | if err != nil { 30 | fmt.Printf("%s\n", err) 31 | os.Exit(1) 32 | } else { 33 | output.SetHeaders([]string{"URI", "Size", "SHA-1"}) 34 | for _, v := range u.Files { 35 | _ = output.AddRow([]string{v.URI, fmt.Sprintf("%d", v.Size), v.SHA1}) 36 | } 37 | 38 | output.Draw() 39 | os.Exit(0) 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /vendor/gopkg.in/alecthomas/kingpin.v2/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (C) 2014 Alec Thomas 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/github.com/olekukonko/tablewriter/LICENCE.md: -------------------------------------------------------------------------------- 1 | Copyright (C) 2014 by Oleku Konko 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /vendor/gopkg.in/alecthomas/kingpin.v2/actions.go: -------------------------------------------------------------------------------- 1 | package kingpin 2 | 3 | // Action callback executed at various stages after all values are populated. 4 | // The application, commands, arguments and flags all have corresponding 5 | // actions. 6 | type Action func(*ParseContext) error 7 | 8 | type actionMixin struct { 9 | actions []Action 10 | preActions []Action 11 | } 12 | 13 | type actionApplier interface { 14 | applyActions(*ParseContext) error 15 | applyPreActions(*ParseContext) error 16 | } 17 | 18 | func (a *actionMixin) addAction(action Action) { 19 | a.actions = append(a.actions, action) 20 | } 21 | 22 | func (a *actionMixin) addPreAction(action Action) { 23 | a.preActions = append(a.preActions, action) 24 | } 25 | 26 | func (a *actionMixin) applyActions(context *ParseContext) error { 27 | for _, action := range a.actions { 28 | if err := action(context); err != nil { 29 | return err 30 | } 31 | } 32 | return nil 33 | } 34 | 35 | func (a *actionMixin) applyPreActions(context *ParseContext) error { 36 | for _, preAction := range a.preActions { 37 | if err := preAction(context); err != nil { 38 | return err 39 | } 40 | } 41 | return nil 42 | } 43 | -------------------------------------------------------------------------------- /artifactory.v51/assets/test/local_repository_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "key" : "libs-release-local", 3 | "packageType" : "maven", 4 | "description" : "Local repository for in-house libraries", 5 | "notes" : "", 6 | "includesPattern" : "**/*", 7 | "excludesPattern" : "", 8 | "repoLayoutRef" : "maven-2-default", 9 | "enableNuGetSupport" : false, 10 | "enableGemsSupport" : false, 11 | "enableNpmSupport" : false, 12 | "enableBowerSupport" : false, 13 | "enableDebianSupport" : false, 14 | "debianTrivialLayout" : false, 15 | "enablePypiSupport" : false, 16 | "enableDockerSupport" : false, 17 | "dockerApiVersion" : "V1", 18 | "forceDockerAuthentication" : false, 19 | "enableVagrantSupport" : false, 20 | "enableGitLfsSupport" : false, 21 | "checksumPolicyType" : "client-checksums", 22 | "handleReleases" : true, 23 | "handleSnapshots" : false, 24 | "maxUniqueSnapshots" : 0, 25 | "snapshotVersionBehavior" : "unique", 26 | "suppressPomConsistencyChecks" : true, 27 | "blackedOut" : false, 28 | "propertySets" : [ "artifactory" ], 29 | "archiveBrowsingEnabled" : false, 30 | "calculateYumMetadata" : false, 31 | "yumRootDepth" : 0, 32 | "rclass" : "local" 33 | } 34 | -------------------------------------------------------------------------------- /src/artifactory.v401/assets/test/local_repository_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "key" : "libs-release-local", 3 | "packageType" : "maven", 4 | "description" : "Local repository for in-house libraries", 5 | "notes" : "", 6 | "includesPattern" : "**/*", 7 | "excludesPattern" : "", 8 | "repoLayoutRef" : "maven-2-default", 9 | "enableNuGetSupport" : false, 10 | "enableGemsSupport" : false, 11 | "enableNpmSupport" : false, 12 | "enableBowerSupport" : false, 13 | "enableDebianSupport" : false, 14 | "debianTrivialLayout" : false, 15 | "enablePypiSupport" : false, 16 | "enableDockerSupport" : false, 17 | "dockerApiVersion" : "V1", 18 | "forceDockerAuthentication" : false, 19 | "enableVagrantSupport" : false, 20 | "enableGitLfsSupport" : false, 21 | "checksumPolicyType" : "client-checksums", 22 | "handleReleases" : true, 23 | "handleSnapshots" : false, 24 | "maxUniqueSnapshots" : 0, 25 | "snapshotVersionBehavior" : "unique", 26 | "suppressPomConsistencyChecks" : true, 27 | "blackedOut" : false, 28 | "propertySets" : [ "artifactory" ], 29 | "archiveBrowsingEnabled" : false, 30 | "calculateYumMetadata" : false, 31 | "yumRootDepth" : 0, 32 | "rclass" : "local" 33 | } 34 | -------------------------------------------------------------------------------- /src/artifactory.v491/assets/test/local_repository_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "key" : "libs-release-local", 3 | "packageType" : "maven", 4 | "description" : "Local repository for in-house libraries", 5 | "notes" : "", 6 | "includesPattern" : "**/*", 7 | "excludesPattern" : "", 8 | "repoLayoutRef" : "maven-2-default", 9 | "enableNuGetSupport" : false, 10 | "enableGemsSupport" : false, 11 | "enableNpmSupport" : false, 12 | "enableBowerSupport" : false, 13 | "enableDebianSupport" : false, 14 | "debianTrivialLayout" : false, 15 | "enablePypiSupport" : false, 16 | "enableDockerSupport" : false, 17 | "dockerApiVersion" : "V1", 18 | "forceDockerAuthentication" : false, 19 | "enableVagrantSupport" : false, 20 | "enableGitLfsSupport" : false, 21 | "checksumPolicyType" : "client-checksums", 22 | "handleReleases" : true, 23 | "handleSnapshots" : false, 24 | "maxUniqueSnapshots" : 0, 25 | "snapshotVersionBehavior" : "unique", 26 | "suppressPomConsistencyChecks" : true, 27 | "blackedOut" : false, 28 | "propertySets" : [ "artifactory" ], 29 | "archiveBrowsingEnabled" : false, 30 | "calculateYumMetadata" : false, 31 | "yumRootDepth" : 0, 32 | "rclass" : "local" 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/lusis/outputter/example/cobra/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | 6 | outputter "github.com/lusis/outputter" 7 | "github.com/spf13/cobra" 8 | ) 9 | 10 | var outputFormat string 11 | var outputFormatter outputter.Outputter 12 | 13 | func doOutput(cmd *cobra.Command, args []string) { 14 | outputFormatter, err := outputter.NewOutputter(outputFormat) 15 | if err != nil { 16 | log.Fatalf("unable to create an outputter: %s", err.Error()) 17 | } 18 | outputFormatter.SetHeaders([]string{"header1", "header2", "header3"}) 19 | rowErr := outputFormatter.AddRow([]string{"value1", "value2", "value3"}) 20 | if rowErr != nil { 21 | log.Fatalf("error adding row: %s", rowErr.Error()) 22 | } 23 | outputFormatter.Draw() 24 | } 25 | func main() { 26 | var rootCmd = &cobra.Command{ 27 | Use: "formatter", 28 | Short: "diplays output in different formats", 29 | } 30 | var outputCmd = &cobra.Command{ 31 | Use: "run", 32 | Run: doOutput, 33 | } 34 | 35 | rootCmd.PersistentFlags().StringVar(&outputFormat, "format", "tabular", "Specify the output format: jsonshort, json, table, tabular") 36 | rootCmd.AddCommand(outputCmd) 37 | 38 | _ = rootCmd.Execute() 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Yasuhiro Matsumoto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/lusis/outputter/errors.go: -------------------------------------------------------------------------------- 1 | package outputter 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | // ErrorHeadersAlreadyAdded is an error for already having headers set 8 | var ErrorHeadersAlreadyAdded = errors.New("Headers already set. Cannot overwrite") 9 | 10 | // ErrorOutputAddRowNoHeaders is an error for not having yet called SetHeaders() 11 | var ErrorOutputAddRowNoHeaders = errors.New("Cannot AddRow with before calling SetHeaders") 12 | 13 | // ErrorOutputAddRowTooFewHeaders is an error for having fewer keys than values 14 | var ErrorOutputAddRowTooFewHeaders = errors.New("Cannot AddRow with more values than headers") 15 | 16 | // ErrorUnknownOutputter is an error for specifying an unknown ErrorUnknownFormatter 17 | var ErrorUnknownOutputter = errors.New("Unknown formatter specified") 18 | 19 | // ErrorInvalidOutputter is an erro for specifying that a registered output isn't an Ouputter 20 | var ErrorInvalidOutputter = errors.New("Specified outputter is invalid") 21 | 22 | // ErrorCannotChangeWriter is an error for specifying that an output does not allow changing the writer after data is populated 23 | var ErrorCannotChangeWriter = errors.New("Must call SetWriter before any data is added") 24 | -------------------------------------------------------------------------------- /cmd/artif-list-repos/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | "github.com/lusis/outputter" 8 | 9 | kingpin "gopkg.in/alecthomas/kingpin.v2" 10 | 11 | artifactory "github.com/lusis/go-artifactory/artifactory.v54" 12 | ) 13 | 14 | var ( 15 | format = kingpin.Flag("format", "format to display output"). 16 | Default("table"). 17 | Enum(outputter.GetOutputters()...) 18 | kind = kingpin.Flag("kind", "Types of repos to show").Default("all").Enum("local", "remote", "virtual", "all") 19 | ) 20 | 21 | func main() { 22 | kingpin.Parse() 23 | output, _ := outputter.NewOutputter(*format) 24 | client, clientErr := artifactory.NewClientFromEnv() 25 | if clientErr != nil { 26 | fmt.Printf("%s\n", clientErr.Error()) 27 | os.Exit(1) 28 | } 29 | data, err := client.GetRepos(*kind) 30 | if err != nil { 31 | fmt.Printf("%s\n", err) 32 | os.Exit(1) 33 | } else { 34 | output.SetHeaders([]string{ 35 | "Key", 36 | "Type", 37 | "Description", 38 | "Url", 39 | }) 40 | for _, r := range data { 41 | _ = output.AddRow([]string{ 42 | r.Key, 43 | r.Rtype, 44 | r.Description, 45 | r.URL, 46 | }) 47 | } 48 | output.Draw() 49 | os.Exit(0) 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /cmd/artif-get-group/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "strconv" 7 | 8 | "github.com/lusis/outputter" 9 | 10 | artifactory "github.com/lusis/go-artifactory/artifactory.v54" 11 | kingpin "gopkg.in/alecthomas/kingpin.v2" 12 | ) 13 | 14 | var ( 15 | format = kingpin.Flag("format", "format to display output"). 16 | Default("table"). 17 | Enum("table", "json", "tabular") 18 | group = kingpin.Arg("group", "group name to show").Required().String() 19 | ) 20 | 21 | func main() { 22 | kingpin.Parse() 23 | output, _ := outputter.NewOutputter(*format) 24 | client, cErr := artifactory.NewClientFromEnv() 25 | if cErr != nil { 26 | fmt.Printf("unable to get an artifactory client: %s\n", cErr.Error()) 27 | os.Exit(1) 28 | } 29 | u, err := client.GetGroupDetails(*group, make(map[string]string)) 30 | if err != nil { 31 | fmt.Printf("%s\n", err) 32 | os.Exit(1) 33 | } else { 34 | output.SetHeaders([]string{"Name", "Description", "AutoJoin?", "Realm", "Realm Attributes"}) 35 | _ = output.AddRow([]string{ 36 | u.Name, 37 | u.Description, 38 | strconv.FormatBool(u.AutoJoin), 39 | u.Realm, 40 | u.RealmAttributes, 41 | }) 42 | output.Draw() 43 | os.Exit(0) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /cmd/artif-list-users/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | artifactory "github.com/lusis/go-artifactory/artifactory.v54" 8 | "github.com/lusis/outputter" 9 | kingpin "gopkg.in/alecthomas/kingpin.v2" 10 | ) 11 | 12 | var ( 13 | formatUsage = fmt.Sprintf("Format to show results [table, csv, list (usernames only - useful for piping)]") 14 | format = kingpin.Flag("format", "format to display output"). 15 | Default("table"). 16 | Enum(outputter.GetOutputters()...) 17 | ) 18 | 19 | func main() { 20 | kingpin.UsageTemplate(kingpin.CompactUsageTemplate).Version("1.0").Author("John E. Vincent") 21 | kingpin.CommandLine.Help = "List all users in Artifactory" 22 | kingpin.Parse() 23 | output, _ := outputter.NewOutputter(*format) 24 | client, clientErr := artifactory.NewClientFromEnv() 25 | if clientErr != nil { 26 | fmt.Printf("%s\n", clientErr.Error()) 27 | os.Exit(1) 28 | } 29 | data, err := client.GetUsers() 30 | if err != nil { 31 | fmt.Printf("%s\n", err) 32 | os.Exit(1) 33 | } else { 34 | output.SetHeaders([]string{"Name", "Uri"}) 35 | 36 | for _, u := range data { 37 | _ = output.AddRow([]string{u.Name, u.URI}) 38 | } 39 | output.Draw() 40 | os.Exit(0) 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell 2 | 3 | Please consider promoting this project if you find it useful. 4 | 5 | Permission is hereby granted, free of charge, to any person 6 | obtaining a copy of this software and associated documentation 7 | files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, 9 | publish, distribute, sublicense, and/or sell copies of the Software, 10 | and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included 14 | in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 20 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 21 | OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 22 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /vendor/gopkg.in/alecthomas/kingpin.v2/_examples/chat2/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "os" 5 | "strings" 6 | 7 | "gopkg.in/alecthomas/kingpin.v2" 8 | ) 9 | 10 | var ( 11 | app = kingpin.New("chat", "A command-line chat application.") 12 | debug = app.Flag("debug", "Enable debug mode.").Bool() 13 | serverIP = app.Flag("server", "Server address.").Default("127.0.0.1").IP() 14 | 15 | register = app.Command("register", "Register a new user.") 16 | registerNick = register.Arg("nick", "Nickname for user.").Required().String() 17 | registerName = register.Arg("name", "Name of user.").Required().String() 18 | 19 | post = app.Command("post", "Post a message to a channel.") 20 | postImage = post.Flag("image", "Image to post.").File() 21 | postChannel = post.Arg("channel", "Channel to post to.").Required().String() 22 | postText = post.Arg("text", "Text to post.").Strings() 23 | ) 24 | 25 | func main() { 26 | switch kingpin.MustParse(app.Parse(os.Args[1:])) { 27 | // Register user 28 | case register.FullCommand(): 29 | println(*registerNick) 30 | 31 | // Post message 32 | case post.FullCommand(): 33 | if *postImage != nil { 34 | } 35 | text := strings.Join(*postText, " ") 36 | println("Post:", text) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/LICENCE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell 2 | 3 | Please consider promoting this project if you find it useful. 4 | 5 | Permission is hereby granted, free of charge, to any person 6 | obtaining a copy of this software and associated documentation 7 | files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, 9 | publish, distribute, sublicense, and/or sell copies of the Software, 10 | and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included 14 | in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 20 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 21 | OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 22 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /vendor/gopkg.in/alecthomas/kingpin.v2/examples_test.go: -------------------------------------------------------------------------------- 1 | package kingpin 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | "strings" 7 | ) 8 | 9 | type HTTPHeaderValue http.Header 10 | 11 | func (h *HTTPHeaderValue) Set(value string) error { 12 | parts := strings.SplitN(value, ":", 2) 13 | if len(parts) != 2 { 14 | return fmt.Errorf("expected HEADER:VALUE got '%s'", value) 15 | } 16 | (*http.Header)(h).Add(parts[0], parts[1]) 17 | return nil 18 | } 19 | 20 | func (h *HTTPHeaderValue) Get() interface{} { 21 | return (http.Header)(*h) 22 | } 23 | 24 | func (h *HTTPHeaderValue) String() string { 25 | return "" 26 | } 27 | 28 | func HTTPHeader(s Settings) (target *http.Header) { 29 | target = new(http.Header) 30 | s.SetValue((*HTTPHeaderValue)(target)) 31 | return 32 | } 33 | 34 | // This example ilustrates how to define custom parsers. HTTPHeader 35 | // cumulatively parses each encountered --header flag into a http.Header struct. 36 | func ExampleValue() { 37 | var ( 38 | curl = New("curl", "transfer a URL") 39 | headers = HTTPHeader(curl.Flag("headers", "Add HTTP headers to the request.").Short('H').PlaceHolder("HEADER:VALUE")) 40 | ) 41 | 42 | curl.Parse([]string{"-H Content-Type:application/octet-stream"}) 43 | for key, value := range *headers { 44 | fmt.Printf("%s = %s\n", key, value) 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/spew/dumpnocgo_test.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 Dave Collins 2 | // 3 | // Permission to use, copy, modify, and distribute this software for any 4 | // purpose with or without fee is hereby granted, provided that the above 5 | // copyright notice and this permission notice appear in all copies. 6 | // 7 | // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 | // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 | // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 10 | // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 | // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 12 | // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 13 | // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 | 15 | // NOTE: Due to the following build constraints, this file will only be compiled 16 | // when either cgo is not supported or "-tags testcgo" is not added to the go 17 | // test command line. This file intentionally does not setup any cgo tests in 18 | // this scenario. 19 | // +build !cgo !testcgo 20 | 21 | package spew_test 22 | 23 | func addCgoDumpTests() { 24 | // Don't add any tests for cgo since this file is only compiled when 25 | // there should not be any cgo tests. 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/pmezard/go-difflib/README.md: -------------------------------------------------------------------------------- 1 | go-difflib 2 | ========== 3 | 4 | [![Build Status](https://travis-ci.org/pmezard/go-difflib.png?branch=master)](https://travis-ci.org/pmezard/go-difflib) 5 | [![GoDoc](https://godoc.org/github.com/pmezard/go-difflib/difflib?status.svg)](https://godoc.org/github.com/pmezard/go-difflib/difflib) 6 | 7 | Go-difflib is a partial port of python 3 difflib package. Its main goal 8 | was to make unified and context diff available in pure Go, mostly for 9 | testing purposes. 10 | 11 | The following class and functions (and related tests) have be ported: 12 | 13 | * `SequenceMatcher` 14 | * `unified_diff()` 15 | * `context_diff()` 16 | 17 | ## Installation 18 | 19 | ```bash 20 | $ go get github.com/pmezard/go-difflib/difflib 21 | ``` 22 | 23 | ### Quick Start 24 | 25 | Diffs are configured with Unified (or ContextDiff) structures, and can 26 | be output to an io.Writer or returned as a string. 27 | 28 | ```Go 29 | diff := UnifiedDiff{ 30 | A: difflib.SplitLines("foo\nbar\n"), 31 | B: difflib.SplitLines("foo\nbaz\n"), 32 | FromFile: "Original", 33 | ToFile: "Current", 34 | Context: 3, 35 | } 36 | text, _ := GetUnifiedDiffString(diff) 37 | fmt.Printf(text) 38 | ``` 39 | 40 | would output: 41 | 42 | ``` 43 | --- Original 44 | +++ Current 45 | @@ -1,3 +1,3 @@ 46 | foo 47 | -bar 48 | +baz 49 | ``` 50 | 51 | -------------------------------------------------------------------------------- /cmd/artif-vagrant-search/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | artifactory "github.com/lusis/go-artifactory/artifactory.v54" 8 | "github.com/lusis/outputter" 9 | kingpin "gopkg.in/alecthomas/kingpin.v2" 10 | ) 11 | 12 | var ( 13 | format = kingpin.Flag("format", "format to display output"). 14 | Default("table"). 15 | Enum(outputter.GetOutputters()...) 16 | criteria = kingpin.Arg("criteria", "what to search for").Required().String() 17 | ) 18 | 19 | func main() { 20 | kingpin.Parse() 21 | output, _ := outputter.NewOutputter(*format) 22 | client, clientErr := artifactory.NewClientFromEnv() 23 | if clientErr != nil { 24 | fmt.Printf("%s\n", clientErr.Error()) 25 | os.Exit(1) 26 | } 27 | data, err := client.VagrantSearch(*criteria) 28 | if err != nil { 29 | fmt.Printf("%s\n", err) 30 | os.Exit(1) 31 | } 32 | theaders := []string{ 33 | "NAME", 34 | "VERSION", 35 | "PROVIDER", 36 | "MODIFIED", 37 | "MODIFIED BY", 38 | } 39 | output.SetHeaders(theaders) 40 | 41 | for _, d := range data { 42 | props := make(map[string]string) 43 | for _, prop := range d.Properties { 44 | props[prop.Key] = prop.Value 45 | } 46 | tdata := []string{ 47 | fmt.Sprintf("%s/%s", d.Repo, props["box_name"]), 48 | props["box_version"], 49 | props["box_provider"], 50 | d.Modified, 51 | d.ModifiedBy, 52 | } 53 | _ = output.AddRow(tdata) 54 | } 55 | output.Draw() 56 | os.Exit(0) 57 | } 58 | -------------------------------------------------------------------------------- /artifactory.v54/system.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | import "encoding/json" 4 | 5 | // VersionInfo represents the version information about Artifactory 6 | type VersionInfo struct { 7 | Version string `json:"version"` 8 | Revision string `json:"revision"` 9 | Addons []string `json:"addons"` 10 | } 11 | 12 | // GetSystemInfo returns the general system information about Artifactory 13 | func (c *Client) GetSystemInfo() (string, error) { 14 | d, e := c.Get("/api/system", make(map[string]string)) 15 | return string(d), e 16 | } 17 | 18 | // GetSystemHealthPing returns a simple status response about the state of Artifactory 19 | func (c *Client) GetSystemHealthPing() (string, error) { 20 | d, e := c.Get("/api/system/ping", make(map[string]string)) 21 | return string(d), e 22 | } 23 | 24 | // GetGeneralConfiguration returns the general Artifactory configuration 25 | func (c *Client) GetGeneralConfiguration() (string, error) { 26 | d, e := c.Get("/api/system/configuration", make(map[string]string)) 27 | return string(d), e 28 | } 29 | 30 | // GetVersionAndAddOnInfo returns information about the current Artifactory version, revision, and currently installed Add-ons 31 | func (c *Client) GetVersionAndAddOnInfo() (VersionInfo, error) { 32 | var res VersionInfo 33 | d, err := c.Get("/api/system/version", make(map[string]string)) 34 | if err != nil { 35 | return res, err 36 | } 37 | err = json.Unmarshal(d, &res) 38 | 39 | return res, err 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/http/test_response_writer.go: -------------------------------------------------------------------------------- 1 | package http 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | // TestResponseWriter DEPRECATED: We recommend you use http://golang.org/pkg/net/http/httptest instead. 8 | type TestResponseWriter struct { 9 | 10 | // StatusCode is the last int written by the call to WriteHeader(int) 11 | StatusCode int 12 | 13 | // Output is a string containing the written bytes using the Write([]byte) func. 14 | Output string 15 | 16 | // header is the internal storage of the http.Header object 17 | header http.Header 18 | } 19 | 20 | // Header DEPRECATED: We recommend you use http://golang.org/pkg/net/http/httptest instead. 21 | func (rw *TestResponseWriter) Header() http.Header { 22 | 23 | if rw.header == nil { 24 | rw.header = make(http.Header) 25 | } 26 | 27 | return rw.header 28 | } 29 | 30 | // Write DEPRECATED: We recommend you use http://golang.org/pkg/net/http/httptest instead. 31 | func (rw *TestResponseWriter) Write(bytes []byte) (int, error) { 32 | 33 | // assume 200 success if no header has been set 34 | if rw.StatusCode == 0 { 35 | rw.WriteHeader(200) 36 | } 37 | 38 | // add these bytes to the output string 39 | rw.Output = rw.Output + string(bytes) 40 | 41 | // return normal values 42 | return 0, nil 43 | 44 | } 45 | 46 | // WriteHeader DEPRECATED: We recommend you use http://golang.org/pkg/net/http/httptest instead. 47 | func (rw *TestResponseWriter) WriteHeader(i int) { 48 | rw.StatusCode = i 49 | } 50 | -------------------------------------------------------------------------------- /cmd/artif-get-artifact/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "io/ioutil" 6 | "os" 7 | "path/filepath" 8 | 9 | kingpin "gopkg.in/alecthomas/kingpin.v2" 10 | 11 | artifactory "github.com/lusis/go-artifactory/artifactory.v54" 12 | ) 13 | 14 | var ( 15 | repo = kingpin.Arg("repo", "repository key for download").Required().String() 16 | file = kingpin.Arg("filename", "full path and file to download").Required().String() 17 | output = kingpin.Flag("output", "output file").String() 18 | silent = kingpin.Flag("silent", "supress output").Bool() 19 | ) 20 | 21 | func main() { 22 | kingpin.Parse() 23 | client, clientErr := artifactory.NewClientFromEnv() 24 | if clientErr != nil { 25 | fmt.Printf("%s\n", clientErr.Error()) 26 | os.Exit(1) 27 | } 28 | _, destination := filepath.Split(*file) 29 | if *output != "" { 30 | destination = *output 31 | } else { 32 | curdir, err := os.Getwd() 33 | if err != nil { 34 | fmt.Printf("Unable to get current directory: %s", err.Error()) 35 | os.Exit(1) 36 | } 37 | destination = curdir + "/" + destination 38 | } 39 | 40 | if !*silent { 41 | fmt.Printf("Writing file to: %s", destination) 42 | } 43 | i, err := client.RetrieveArtifact(*repo, *file) 44 | if err != nil { 45 | fmt.Printf("%s\n", err) 46 | os.Exit(1) 47 | } else { 48 | err := ioutil.WriteFile(destination, i, 0600) 49 | if err != nil { 50 | fmt.Printf("%s\n", err) 51 | os.Exit(1) 52 | } else { 53 | os.Exit(0) 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /cmd/artif-get-user/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "strconv" 7 | "strings" 8 | 9 | artifactory "github.com/lusis/go-artifactory/artifactory.v54" 10 | "github.com/lusis/outputter" 11 | kingpin "gopkg.in/alecthomas/kingpin.v2" 12 | ) 13 | 14 | var ( 15 | format = kingpin.Flag("format", "format to display output"). 16 | Default("table"). 17 | Enum(outputter.GetOutputters()...) 18 | user = kingpin.Arg("user", "User name to show").Required().String() 19 | ) 20 | 21 | func main() { 22 | kingpin.Parse() 23 | output, _ := outputter.NewOutputter(*format) 24 | client, clientErr := artifactory.NewClientFromEnv() 25 | if clientErr != nil { 26 | fmt.Printf("%s\n", clientErr.Error()) 27 | os.Exit(1) 28 | } 29 | u, err := client.GetUserDetails(*user, make(map[string]string)) 30 | if err != nil { 31 | fmt.Printf("%s\n", err) 32 | os.Exit(1) 33 | } else { 34 | 35 | output.SetHeaders([]string{ 36 | "Name", 37 | "Email", 38 | "Password", 39 | "Admin?", 40 | "Updatable?", 41 | "Last Logged In", 42 | "Internal Password Disabled?", 43 | "Realm", 44 | "Groups", 45 | }) 46 | _ = output.AddRow([]string{ 47 | u.Name, 48 | u.Email, 49 | "", 50 | strconv.FormatBool(u.Admin), 51 | strconv.FormatBool(u.ProfileUpdatable), 52 | u.LastLoggedIn, 53 | strconv.FormatBool(u.InternalPasswordDisabled), 54 | u.Realm, 55 | strings.Join(u.Groups, ","), 56 | }) 57 | output.Draw() 58 | os.Exit(0) 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /artifactory.v54/assets/test/remote_repository_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "key" : "jcenter", 3 | "rclass" : "remote", 4 | "packageType" : "maven", 5 | "description" : "Bintray Central Java repository", 6 | "notes" : "", 7 | "includesPattern" : "**/*", 8 | "excludesPattern" : "", 9 | "repoLayoutRef" : "maven-2-default", 10 | "handleReleases" : true, 11 | "handleSnapshots" : false, 12 | "maxUniqueSnapshots" : 0, 13 | "suppressPomConsistencyChecks" : true, 14 | "blackedOut" : false, 15 | "propertySets" : [ "artifactory" ], 16 | "url" : "http://jcenter.bintray.com", 17 | "username" : "", 18 | "password" : "", 19 | "proxy" : "proxy", 20 | "remoteRepoChecksumPolicyType" : "", 21 | "hardFail" : false, 22 | "offline" : false, 23 | "storeArtifactsLocally" : true, 24 | "socketTimeoutMillis" : 15000, 25 | "localAddress" : "", 26 | "retrievalCachePeriodSecs" : 43200, 27 | "failedRetrievalCachePeriodSecs" : 7200, 28 | "missedRetrievalCachePeriodSecs" : 7200, 29 | "unusedArtifactCleanupEnabled" : false, 30 | "unusedArtifactsCleanupPeriodHours" : 0, 31 | "fetchJarsEagerly" : false, 32 | "fetchSourcesEagerly" : false, 33 | "shareConfiguration" : false, 34 | "synchronizeProperties" : false, 35 | "blockMismatchingMimeTypes" : false, 36 | "allowAnyHostAuth" : false, 37 | "enableCookieManagement" : false, 38 | "bowerRegistryUrl" : "http://bower.registry.com", 39 | "vcsType" : "", 40 | "vcsGitProvider" : "", 41 | "vcsGitDownloader" : "", 42 | "clientTlsCertificate" : "" 43 | } 44 | -------------------------------------------------------------------------------- /src/artifactory.v401/permissions_targets.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | type PermissionTarget struct { 8 | Name string `json:"name"` 9 | Uri string `json:"uri"` 10 | } 11 | 12 | type PermissionTargetDetails struct { 13 | Name string `json:"name,omitempty"` 14 | IncludesPattern string `json:"includesPattern,omitempty"` 15 | ExcludesPattern string `json:"excludesPattern,omitempty"` 16 | Repositories []string `json:"repositories,omitempty"` 17 | Principals Principals `json:"principals,omitempty"` 18 | } 19 | 20 | type Principals struct { 21 | Users map[string][]string `json:"users"` 22 | Groups map[string][]string `json:"groups"` 23 | } 24 | 25 | func (c *ArtifactoryClient) GetPermissionTargets() ([]PermissionTarget, error) { 26 | var res []PermissionTarget 27 | d, e := c.Get("/api/security/permissions", make(map[string]string)) 28 | if e != nil { 29 | return res, e 30 | } else { 31 | err := json.Unmarshal(d, &res) 32 | if err != nil { 33 | return res, err 34 | } else { 35 | return res, e 36 | } 37 | } 38 | } 39 | 40 | func (c *ArtifactoryClient) GetPermissionTargetDetails(u string) (PermissionTargetDetails, error) { 41 | var res PermissionTargetDetails 42 | d, e := c.Get("/api/security/permissions/"+u, make(map[string]string)) 43 | if e != nil { 44 | return res, e 45 | } else { 46 | err := json.Unmarshal(d, &res) 47 | if err != nil { 48 | return res, err 49 | } else { 50 | return res, e 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/artifactory.v491/permissions_targets.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | type PermissionTarget struct { 8 | Name string `json:"name"` 9 | Uri string `json:"uri"` 10 | } 11 | 12 | type PermissionTargetDetails struct { 13 | Name string `json:"name,omitempty"` 14 | IncludesPattern string `json:"includesPattern,omitempty"` 15 | ExcludesPattern string `json:"excludesPattern,omitempty"` 16 | Repositories []string `json:"repositories,omitempty"` 17 | Principals Principals `json:"principals,omitempty"` 18 | } 19 | 20 | type Principals struct { 21 | Users map[string][]string `json:"users"` 22 | Groups map[string][]string `json:"groups"` 23 | } 24 | 25 | func (c *ArtifactoryClient) GetPermissionTargets() ([]PermissionTarget, error) { 26 | var res []PermissionTarget 27 | d, e := c.Get("/api/security/permissions", make(map[string]string)) 28 | if e != nil { 29 | return res, e 30 | } else { 31 | err := json.Unmarshal(d, &res) 32 | if err != nil { 33 | return res, err 34 | } else { 35 | return res, e 36 | } 37 | } 38 | } 39 | 40 | func (c *ArtifactoryClient) GetPermissionTargetDetails(u string) (PermissionTargetDetails, error) { 41 | var res PermissionTargetDetails 42 | d, e := c.Get("/api/security/permissions/"+u, make(map[string]string)) 43 | if e != nil { 44 | return res, e 45 | } else { 46 | err := json.Unmarshal(d, &res) 47 | if err != nil { 48 | return res, err 49 | } else { 50 | return res, e 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /artifactory.v51/client_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | "net/http/httptest" 7 | "net/url" 8 | "testing" 9 | 10 | "github.com/stretchr/testify/assert" 11 | ) 12 | 13 | func TestNewClientCustomTransport(t *testing.T) { 14 | server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 15 | w.WriteHeader(200) 16 | w.Header().Set("Content-Type", "application/json") 17 | fmt.Fprint(w, "pong") 18 | })) 19 | transport := &http.Transport{ 20 | Proxy: func(req *http.Request) (*url.URL, error) { 21 | return url.Parse(server.URL) 22 | }, 23 | } 24 | defer server.Close() 25 | conf := &ClientConfig{ 26 | BaseURL: "http://127.0.0.1:8080/", 27 | Username: "username", 28 | Password: "password", 29 | VerifySSL: false, 30 | Transport: transport, 31 | } 32 | 33 | client := NewClient(conf) 34 | res, err := client.Get("/ping", make(map[string]string)) 35 | assert.Nil(t, err, "should not return an error") 36 | assert.NotNil(t, client.Transport) 37 | assert.Equal(t, "pong", string(res), "should return the testmsg") 38 | } 39 | 40 | func TestClientHTTPVerifySSLTrue(t *testing.T) { 41 | conf := &ClientConfig{VerifySSL: true} 42 | client := NewClient(conf) 43 | assert.False(t, client.Transport.TLSClientConfig.InsecureSkipVerify) 44 | } 45 | 46 | func TestClientHTTPVerifySSLFalse(t *testing.T) { 47 | conf := &ClientConfig{VerifySSL: false} 48 | client := NewClient(conf) 49 | assert.True(t, client.Transport.TLSClientConfig.InsecureSkipVerify) 50 | } 51 | -------------------------------------------------------------------------------- /src/artifactory.v491/storage.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | type CreatedStorageItem struct { 8 | URI string `json:"uri"` 9 | DownloadURI string `json:"downloadUri"` 10 | Repo string `json:"repo"` 11 | Created string `json:"created"` 12 | CreatedBy string `json:"createdBy"` 13 | Size string `json:"size"` 14 | MimeType string `json:"mimeType"` 15 | Checksums ArtifactChecksums `json:"checksums"` 16 | OriginalChecksums ArtifactChecksums `json:"originalChecksums"` 17 | } 18 | 19 | type ArtifactChecksums struct { 20 | MD5 string `json:"md5"` 21 | SHA1 string `json:"sha1"` 22 | } 23 | 24 | type FileList struct { 25 | URI string `json:"uri"` 26 | Created string `json:"created"` 27 | Files []FileListItem `json:"files"` 28 | } 29 | 30 | type FileListItem struct { 31 | URI string `json:"uri"` 32 | Size int `json:"size"` 33 | LastModified string `json:"lastModified"` 34 | Folder bool `json:"folder"` 35 | SHA1 string `json:"sha1"` 36 | } 37 | 38 | func (c *ArtifactoryClient) ListFiles(repo string) (fileList FileList, err error) { 39 | d, err := c.HttpRequest(ArtifactoryRequest{ 40 | Verb: "GET", 41 | Path: "/api/storage/" + repo + "?list&deep=1", 42 | }) 43 | if err != nil { 44 | return fileList, err 45 | } 46 | err = json.Unmarshal(d, &fileList) 47 | return fileList, err 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/alecthomas/units/bytes_test.go: -------------------------------------------------------------------------------- 1 | package units 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/assert" 7 | ) 8 | 9 | func TestBase2BytesString(t *testing.T) { 10 | assert.Equal(t, Base2Bytes(0).String(), "0B") 11 | assert.Equal(t, Base2Bytes(1025).String(), "1KiB1B") 12 | assert.Equal(t, Base2Bytes(1048577).String(), "1MiB1B") 13 | } 14 | 15 | func TestParseBase2Bytes(t *testing.T) { 16 | n, err := ParseBase2Bytes("0B") 17 | assert.NoError(t, err) 18 | assert.Equal(t, 0, int(n)) 19 | n, err = ParseBase2Bytes("1KB") 20 | assert.NoError(t, err) 21 | assert.Equal(t, 1024, int(n)) 22 | n, err = ParseBase2Bytes("1MB1KB25B") 23 | assert.NoError(t, err) 24 | assert.Equal(t, 1049625, int(n)) 25 | n, err = ParseBase2Bytes("1.5MB") 26 | assert.NoError(t, err) 27 | assert.Equal(t, 1572864, int(n)) 28 | } 29 | 30 | func TestMetricBytesString(t *testing.T) { 31 | assert.Equal(t, MetricBytes(0).String(), "0B") 32 | assert.Equal(t, MetricBytes(1001).String(), "1KB1B") 33 | assert.Equal(t, MetricBytes(1001025).String(), "1MB1KB25B") 34 | } 35 | 36 | func TestParseMetricBytes(t *testing.T) { 37 | n, err := ParseMetricBytes("0B") 38 | assert.NoError(t, err) 39 | assert.Equal(t, 0, int(n)) 40 | n, err = ParseMetricBytes("1KB1B") 41 | assert.NoError(t, err) 42 | assert.Equal(t, 1001, int(n)) 43 | n, err = ParseMetricBytes("1MB1KB25B") 44 | assert.NoError(t, err) 45 | assert.Equal(t, 1001025, int(n)) 46 | n, err = ParseMetricBytes("1.5MB") 47 | assert.NoError(t, err) 48 | assert.Equal(t, 1500000, int(n)) 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/pmezard/go-difflib/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, Patrick Mezard 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | The names of its contributors may not be used to endorse or promote 14 | products derived from this software without specific prior written 15 | permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 18 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 19 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 20 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 23 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 24 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /src/artifactory.v401/groups.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | type Group struct { 8 | Name string `json:"name"` 9 | Uri string `json:"uri"` 10 | } 11 | 12 | type GroupDetails struct { 13 | Name string `json:"name,omitempty"` 14 | Description string `json:"description,omitempty"` 15 | AutoJoin bool `json:"autoJoin,omitempty"` 16 | Realm string `json:"realm,omitempty"` 17 | RealmAttributes string `json:"realmAttributes,omitempty"` 18 | } 19 | 20 | func (c *ArtifactoryClient) GetGroups() ([]Group, error) { 21 | var res []Group 22 | d, e := c.Get("/api/security/groups", make(map[string]string)) 23 | if e != nil { 24 | return res, e 25 | } else { 26 | err := json.Unmarshal(d, &res) 27 | if err != nil { 28 | return res, err 29 | } else { 30 | return res, e 31 | } 32 | } 33 | } 34 | 35 | func (c *ArtifactoryClient) GetGroupDetails(u string) (GroupDetails, error) { 36 | var res GroupDetails 37 | d, e := c.Get("/api/security/groups/"+u, make(map[string]string)) 38 | if e != nil { 39 | return res, e 40 | } else { 41 | err := json.Unmarshal(d, &res) 42 | if err != nil { 43 | return res, err 44 | } else { 45 | return res, e 46 | } 47 | } 48 | } 49 | 50 | func (c *ArtifactoryClient) CreateGroup(gname string, g GroupDetails) error { 51 | j, jerr := json.Marshal(g) 52 | if jerr != nil { 53 | return jerr 54 | } 55 | o := make(map[string]string) 56 | _, err := c.Put("/api/security/groups/"+gname, string(j), o) 57 | if err != nil { 58 | return err 59 | } 60 | return nil 61 | } 62 | -------------------------------------------------------------------------------- /src/artifactory.v491/groups.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | type Group struct { 8 | Name string `json:"name"` 9 | Uri string `json:"uri"` 10 | } 11 | 12 | type GroupDetails struct { 13 | Name string `json:"name,omitempty"` 14 | Description string `json:"description,omitempty"` 15 | AutoJoin bool `json:"autoJoin,omitempty"` 16 | Realm string `json:"realm,omitempty"` 17 | RealmAttributes string `json:"realmAttributes,omitempty"` 18 | } 19 | 20 | func (c *ArtifactoryClient) GetGroups() ([]Group, error) { 21 | var res []Group 22 | d, e := c.Get("/api/security/groups", make(map[string]string)) 23 | if e != nil { 24 | return res, e 25 | } else { 26 | err := json.Unmarshal(d, &res) 27 | if err != nil { 28 | return res, err 29 | } else { 30 | return res, e 31 | } 32 | } 33 | } 34 | 35 | func (c *ArtifactoryClient) GetGroupDetails(u string) (GroupDetails, error) { 36 | var res GroupDetails 37 | d, e := c.Get("/api/security/groups/"+u, make(map[string]string)) 38 | if e != nil { 39 | return res, e 40 | } else { 41 | err := json.Unmarshal(d, &res) 42 | if err != nil { 43 | return res, err 44 | } else { 45 | return res, e 46 | } 47 | } 48 | } 49 | 50 | func (c *ArtifactoryClient) CreateGroup(gname string, g GroupDetails) error { 51 | j, jerr := json.Marshal(g) 52 | if jerr != nil { 53 | return jerr 54 | } 55 | o := make(map[string]string) 56 | _, err := c.Put("/api/security/groups/"+gname, string(j), o) 57 | if err != nil { 58 | return err 59 | } 60 | return nil 61 | } 62 | -------------------------------------------------------------------------------- /vendor/github.com/olekukonko/tablewriter/csv.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Oleku Konko All rights reserved. 2 | // Use of this source code is governed by a MIT 3 | // license that can be found in the LICENSE file. 4 | 5 | // This module is a Table Writer API for the Go Programming Language. 6 | // The protocols were written in pure Go and works on windows and unix systems 7 | 8 | package tablewriter 9 | 10 | import ( 11 | "encoding/csv" 12 | "io" 13 | "os" 14 | ) 15 | 16 | // Start A new table by importing from a CSV file 17 | // Takes io.Writer and csv File name 18 | func NewCSV(writer io.Writer, fileName string, hasHeader bool) (*Table, error) { 19 | file, err := os.Open(fileName) 20 | if err != nil { 21 | return &Table{}, err 22 | } 23 | defer file.Close() 24 | csvReader := csv.NewReader(file) 25 | t, err := NewCSVReader(writer, csvReader, hasHeader) 26 | return t, err 27 | } 28 | 29 | // Start a New Table Writer with csv.Reader 30 | // This enables customisation such as reader.Comma = ';' 31 | // See http://golang.org/src/pkg/encoding/csv/reader.go?s=3213:3671#L94 32 | func NewCSVReader(writer io.Writer, csvReader *csv.Reader, hasHeader bool) (*Table, error) { 33 | t := NewWriter(writer) 34 | if hasHeader { 35 | // Read the first row 36 | headers, err := csvReader.Read() 37 | if err != nil { 38 | return &Table{}, err 39 | } 40 | t.SetHeader(headers) 41 | } 42 | for { 43 | record, err := csvReader.Read() 44 | if err == io.EOF { 45 | break 46 | } else if err != nil { 47 | return &Table{}, err 48 | } 49 | t.Append(record) 50 | } 51 | return t, nil 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/doc.go: -------------------------------------------------------------------------------- 1 | // Package assert provides a set of comprehensive testing tools for use with the normal Go testing system. 2 | // 3 | // Example Usage 4 | // 5 | // The following is a complete example using assert in a standard test function: 6 | // import ( 7 | // "testing" 8 | // "github.com/stretchr/testify/assert" 9 | // ) 10 | // 11 | // func TestSomething(t *testing.T) { 12 | // 13 | // var a string = "Hello" 14 | // var b string = "Hello" 15 | // 16 | // assert.Equal(t, a, b, "The two words should be the same.") 17 | // 18 | // } 19 | // 20 | // if you assert many times, use the format below: 21 | // 22 | // import ( 23 | // "testing" 24 | // "github.com/stretchr/testify/assert" 25 | // ) 26 | // 27 | // func TestSomething(t *testing.T) { 28 | // assert := assert.New(t) 29 | // 30 | // var a string = "Hello" 31 | // var b string = "Hello" 32 | // 33 | // assert.Equal(a, b, "The two words should be the same.") 34 | // } 35 | // 36 | // Assertions 37 | // 38 | // Assertions allow you to easily write test code, and are global funcs in the `assert` package. 39 | // All assertion functions take, as the first argument, the `*testing.T` object provided by the 40 | // testing framework. This allows the assertion funcs to write the failings and other details to 41 | // the correct place. 42 | // 43 | // Every assertion function also takes an optional string message as the final argument, 44 | // allowing custom error messages to be appended to the message the assertion method outputs. 45 | package assert 46 | -------------------------------------------------------------------------------- /vendor/github.com/alecthomas/template/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /artifactory.v51/mimetypes.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | // LocalRepoMimeType is the mimetype for a local repo 4 | const LocalRepoMimeType string = "application/vnd.org.jfrog.artifactory.repositories.LocalRepositoryConfiguration+json" 5 | 6 | // RemoteRepoMimeType is the mimetype for a remote repo 7 | const RemoteRepoMimeType string = "application/vnd.org.jfrog.artifactory.repositories.RemoteRepositoryConfiguration+json" 8 | 9 | // VirtualRepoMimeType is the mimetype for a virtual repo 10 | const VirtualRepoMimeType string = "application/vnd.org.jfrog.artifactory.repositories.VirtualRepositoryConfiguration+json" 11 | 12 | // UserMimeType is the mimetype for a user 13 | const UserMimeType string = "application/vnd.org.jfrog.artifactory.security.User+json" 14 | 15 | // GroupMimeType is the mimetype for a group 16 | const GroupMimeType string = "application/vnd.org.jfrog.artifactory.security.Group+json" 17 | 18 | // PermissionTargetMimeType is the mimetype for a permission target 19 | const PermissionTargetMimeType string = "application/vnd.org.jfrog.artifactory.security.PermissionTarget+json" 20 | 21 | // ImportSettingsMimeType is the mimetype for import settings 22 | const ImportSettingsMimeType string = "application/vnd.org.jfrog.artifactory.system.ImportSettings+json" 23 | 24 | // ExportSettingsMimeType is the mimetype for export settings 25 | const ExportSettingsMimeType string = "application/vnd.org.jfrog.artifactory.system.ExportSettings+json" 26 | 27 | // SystemVersionMimeType is the mimetype for system version 28 | const SystemVersionMimeType string = "application/vnd.org.jfrog.artifactory.system.Version+json" 29 | -------------------------------------------------------------------------------- /artifactory.v54/mimetypes.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | // LocalRepoMimeType is the mimetype for a local repo 4 | const LocalRepoMimeType string = "application/vnd.org.jfrog.artifactory.repositories.LocalRepositoryConfiguration+json" 5 | 6 | // RemoteRepoMimeType is the mimetype for a remote repo 7 | const RemoteRepoMimeType string = "application/vnd.org.jfrog.artifactory.repositories.RemoteRepositoryConfiguration+json" 8 | 9 | // VirtualRepoMimeType is the mimetype for a virtual repo 10 | const VirtualRepoMimeType string = "application/vnd.org.jfrog.artifactory.repositories.VirtualRepositoryConfiguration+json" 11 | 12 | // UserMimeType is the mimetype for a user 13 | const UserMimeType string = "application/vnd.org.jfrog.artifactory.security.User+json" 14 | 15 | // GroupMimeType is the mimetype for a group 16 | const GroupMimeType string = "application/vnd.org.jfrog.artifactory.security.Group+json" 17 | 18 | // PermissionTargetMimeType is the mimetype for a permission target 19 | const PermissionTargetMimeType string = "application/vnd.org.jfrog.artifactory.security.PermissionTarget+json" 20 | 21 | // ImportSettingsMimeType is the mimetype for import settings 22 | const ImportSettingsMimeType string = "application/vnd.org.jfrog.artifactory.system.ImportSettings+json" 23 | 24 | // ExportSettingsMimeType is the mimetype for export settings 25 | const ExportSettingsMimeType string = "application/vnd.org.jfrog.artifactory.system.ExportSettings+json" 26 | 27 | // SystemVersionMimeType is the mimetype for system version 28 | const SystemVersionMimeType string = "application/vnd.org.jfrog.artifactory.system.Version+json" 29 | -------------------------------------------------------------------------------- /artifactory.v54/groups.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | // Group represents the json response for a group in Artifactory 8 | type Group struct { 9 | Name string `json:"name"` 10 | URI string `json:"uri"` 11 | } 12 | 13 | // GroupDetails represents the json response for a group's details in artifactory 14 | type GroupDetails struct { 15 | Name string `json:"name,omitempty"` 16 | Description string `json:"description,omitempty"` 17 | AutoJoin bool `json:"autoJoin,omitempty"` 18 | Admin bool `json:"admin,omitempty"` 19 | Realm string `json:"realm,omitempty"` 20 | RealmAttributes string `json:"realmAttributes,omitempty"` 21 | } 22 | 23 | // GetGroups gets a list of groups from artifactory 24 | func (c *Client) GetGroups() ([]Group, error) { 25 | var res []Group 26 | d, err := c.Get("/api/security/groups", make(map[string]string)) 27 | if err != nil { 28 | return res, err 29 | } 30 | err = json.Unmarshal(d, &res) 31 | return res, err 32 | } 33 | 34 | // GetGroupDetails returns details for a Group 35 | func (c *Client) GetGroupDetails(key string, q map[string]string) (GroupDetails, error) { 36 | var res GroupDetails 37 | d, err := c.Get("/api/security/groups/"+key, q) 38 | if err != nil { 39 | return res, err 40 | } 41 | err = json.Unmarshal(d, &res) 42 | return res, err 43 | } 44 | 45 | // CreateGroup creates a group in artifactory 46 | func (c *Client) CreateGroup(key string, g GroupDetails, q map[string]string) error { 47 | j, err := json.Marshal(g) 48 | if err != nil { 49 | return err 50 | } 51 | _, err = c.Put("/api/security/groups/"+key, j, q) 52 | return err 53 | } 54 | -------------------------------------------------------------------------------- /artifactory.v51/groups.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | // Group represents the json response for a group in Artifactory 8 | type Group struct { 9 | Name string `json:"name"` 10 | URI string `json:"uri"` 11 | } 12 | 13 | // GroupDetails represents the json response for a group's details in artifactory 14 | type GroupDetails struct { 15 | Name string `json:"name,omitempty"` 16 | Description string `json:"description,omitempty"` 17 | AutoJoin bool `json:"autoJoin,omitempty"` 18 | Realm string `json:"realm,omitempty"` 19 | RealmAttributes string `json:"realmAttributes,omitempty"` 20 | } 21 | 22 | // GetGroups gets a list of groups from artifactory 23 | func (c *Client) GetGroups() ([]Group, error) { 24 | var res []Group 25 | d, e := c.Get("/api/security/groups", make(map[string]string)) 26 | if e != nil { 27 | return res, e 28 | } 29 | err := json.Unmarshal(d, &res) 30 | if err != nil { 31 | return res, err 32 | } 33 | return res, e 34 | } 35 | 36 | // GetGroupDetails returns details for a Group 37 | func (c *Client) GetGroupDetails(u string) (GroupDetails, error) { 38 | var res GroupDetails 39 | d, e := c.Get("/api/security/groups/"+u, make(map[string]string)) 40 | if e != nil { 41 | return res, e 42 | } 43 | err := json.Unmarshal(d, &res) 44 | if err != nil { 45 | return res, err 46 | } 47 | return res, e 48 | } 49 | 50 | // CreateGroup creates a group in artifactory 51 | func (c *Client) CreateGroup(gname string, g GroupDetails) error { 52 | j, jerr := json.Marshal(g) 53 | if jerr != nil { 54 | return jerr 55 | } 56 | o := make(map[string]string) 57 | _, err := c.Put("/api/security/groups/"+gname, string(j), o) 58 | return err 59 | } 60 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/runewidth_posix.go: -------------------------------------------------------------------------------- 1 | // +build !windows,!js 2 | 3 | package runewidth 4 | 5 | import ( 6 | "os" 7 | "regexp" 8 | "strings" 9 | ) 10 | 11 | var reLoc = regexp.MustCompile(`^[a-z][a-z][a-z]?(?:_[A-Z][A-Z])?\.(.+)`) 12 | 13 | var mblenTable = map[string]int{ 14 | "utf-8": 6, 15 | "utf8": 6, 16 | "jis": 8, 17 | "eucjp": 3, 18 | "euckr": 2, 19 | "euccn": 2, 20 | "sjis": 2, 21 | "cp932": 2, 22 | "cp51932": 2, 23 | "cp936": 2, 24 | "cp949": 2, 25 | "cp950": 2, 26 | "big5": 2, 27 | "gbk": 2, 28 | "gb2312": 2, 29 | } 30 | 31 | func isEastAsian(locale string) bool { 32 | charset := strings.ToLower(locale) 33 | r := reLoc.FindStringSubmatch(locale) 34 | if len(r) == 2 { 35 | charset = strings.ToLower(r[1]) 36 | } 37 | 38 | if strings.HasSuffix(charset, "@cjk_narrow") { 39 | return false 40 | } 41 | 42 | for pos, b := range []byte(charset) { 43 | if b == '@' { 44 | charset = charset[:pos] 45 | break 46 | } 47 | } 48 | max := 1 49 | if m, ok := mblenTable[charset]; ok { 50 | max = m 51 | } 52 | if max > 1 && (charset[0] != 'u' || 53 | strings.HasPrefix(locale, "ja") || 54 | strings.HasPrefix(locale, "ko") || 55 | strings.HasPrefix(locale, "zh")) { 56 | return true 57 | } 58 | return false 59 | } 60 | 61 | // IsEastAsian return true if the current locale is CJK 62 | func IsEastAsian() bool { 63 | locale := os.Getenv("LC_CTYPE") 64 | if locale == "" { 65 | locale = os.Getenv("LANG") 66 | } 67 | 68 | // ignore C locale 69 | if locale == "POSIX" || locale == "C" { 70 | return false 71 | } 72 | if len(locale) > 1 && locale[0] == 'C' && (locale[1] == '.' || locale[1] == '-') { 73 | return false 74 | } 75 | 76 | return isEastAsian(locale) 77 | } 78 | -------------------------------------------------------------------------------- /cmd/artif-create-user/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "crypto/rand" 5 | "encoding/base64" 6 | "fmt" 7 | "os" 8 | 9 | kingpin "gopkg.in/alecthomas/kingpin.v2" 10 | 11 | artifactory "github.com/lusis/go-artifactory/artifactory.v54" 12 | ) 13 | 14 | var ( 15 | username = kingpin.Arg("username", "username to create").Required().String() 16 | email = kingpin.Flag("email", "email address for new user").Required().String() 17 | showpass = kingpin.Flag("showpass", "show randomly generated password for new user").Default("false").Bool() 18 | updatable = kingpin.Flag("updatable", "can user update profile?").Bool() 19 | group = kingpin.Flag("group", "optional group for user. specify multiple times for multiple groups").Strings() 20 | ) 21 | 22 | func randPass() string { 23 | b := make([]byte, 16) 24 | rand.Read(b) 25 | encode := base64.StdEncoding 26 | d := make([]byte, encode.EncodedLen(len(b))) 27 | encode.Encode(d, b) 28 | return string(d) 29 | } 30 | 31 | func main() { 32 | kingpin.Parse() 33 | client, clientErr := artifactory.NewClientFromEnv() 34 | if clientErr != nil { 35 | fmt.Printf("%s\n", clientErr.Error()) 36 | } else { 37 | 38 | password := randPass() 39 | 40 | var details = artifactory.UserDetails{ 41 | Email: *email, 42 | Password: password, 43 | } 44 | if group != nil { 45 | details.Groups = *group 46 | } 47 | 48 | if updatable != nil { 49 | details.ProfileUpdatable = *updatable 50 | } 51 | err := client.CreateUser(*username, details, make(map[string]string)) 52 | if err != nil { 53 | fmt.Printf("%s\n", err) 54 | os.Exit(1) 55 | } else { 56 | if *showpass { 57 | fmt.Printf("User created. Random password is: %s\n", password) 58 | } 59 | os.Exit(0) 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /vendor/github.com/lusis/outputter/output.go: -------------------------------------------------------------------------------- 1 | package outputter 2 | 3 | import ( 4 | "io" 5 | "sync" 6 | ) 7 | 8 | var defaultOutput = "tabular" 9 | 10 | // OutputRegistry is a registry of all known outputter types 11 | type OutputRegistry struct { 12 | Outputs map[string]OutputCtr 13 | sync.RWMutex 14 | } 15 | 16 | var registry = &OutputRegistry{Outputs: make(map[string]OutputCtr)} 17 | 18 | // OutputCtr returns a func that creates an Outputter 19 | type OutputCtr func() Outputter 20 | 21 | // RegisterOutput adds an Outputter to the registry 22 | func RegisterOutput(name string, factory OutputCtr) { 23 | if _, exists := registry.Outputs[name]; !exists { 24 | registry.Outputs[name] = factory 25 | } 26 | } 27 | 28 | // Outputter is an interface for multiple ways to draw data to the console 29 | type Outputter interface { 30 | Draw() 31 | SetHeaders([]string) 32 | AddRow([]string) error 33 | ColorSupport() bool 34 | SetPretty() 35 | SetWriter(io.Writer) error 36 | } 37 | 38 | // GetDefaultOutputter returns the default output outputters 39 | func GetDefaultOutputter() Outputter { 40 | f, _ := NewOutputter(defaultOutput) 41 | return f 42 | } 43 | 44 | // GetOutputters returns a list of all supported outputters 45 | func GetOutputters() []string { 46 | var o []string 47 | for name := range registry.Outputs { 48 | o = append(o, name) 49 | } 50 | return o 51 | } 52 | 53 | // NewOutputter returns a new outputter of the specified type 54 | func NewOutputter(outputFormat string) (Outputter, error) { 55 | if _, exists := registry.Outputs[outputFormat]; !exists { 56 | return nil, ErrorUnknownOutputter 57 | } 58 | factory, ok := registry.Outputs[outputFormat] 59 | if !ok { 60 | return nil, ErrorInvalidOutputter 61 | } 62 | o := factory() 63 | return o, nil 64 | } 65 | -------------------------------------------------------------------------------- /cmd/artif-get-permission-target/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "strings" 7 | 8 | "github.com/lusis/outputter" 9 | 10 | artifactory "github.com/lusis/go-artifactory/artifactory.v54" 11 | kingpin "gopkg.in/alecthomas/kingpin.v2" 12 | ) 13 | 14 | var ( 15 | format = kingpin.Flag("format", "format to display output"). 16 | Default("table"). 17 | Enum("table", "json", "tabular") 18 | target = kingpin.Arg("target", "permission target to show").Required().String() 19 | ) 20 | 21 | func main() { 22 | kingpin.Parse() 23 | output, _ := outputter.NewOutputter(*format) 24 | client, clientErr := artifactory.NewClientFromEnv() 25 | if clientErr != nil { 26 | fmt.Printf("unable to get artifactory client: %s\n", clientErr.Error()) 27 | } 28 | u, err := client.GetPermissionTargetDetails(*target, make(map[string]string)) 29 | if err != nil { 30 | fmt.Printf("%s\n", err) 31 | os.Exit(1) 32 | } else { 33 | output.SetHeaders([]string{"Name", "Includes", "Excludes", "Repositories", "Users", "Groups"}) 34 | row := []string{ 35 | u.Name, 36 | u.IncludesPattern, 37 | u.ExcludesPattern, 38 | strings.Join(u.Repositories, "\n"), 39 | } 40 | var users []string 41 | var groups []string 42 | for k, v := range u.Principals.Users { 43 | line := fmt.Sprintf("%s (%s)", k, strings.Join(v, ",")) 44 | users = append(users, line) 45 | } 46 | for k, v := range u.Principals.Groups { 47 | line := fmt.Sprintf("%s (%s)", k, strings.Join(v, ",")) 48 | groups = append(groups, line) 49 | } 50 | row = append(row, strings.Join(users, "\n")) 51 | row = append(row, strings.Join(groups, "\n")) 52 | _ = output.AddRow(row) 53 | output.Draw() 54 | fmt.Println("Legend: m=admin; d=delete; w=deploy; n=annotate; r=read") 55 | os.Exit(0) 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /artifactory.v51/assets/test/remote_repository_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "key" : "jcenter", 3 | "packageType" : "maven", 4 | "description" : "Bintray Central Java repository", 5 | "notes" : "", 6 | "includesPattern" : "**/*", 7 | "excludesPattern" : "", 8 | "repoLayoutRef" : "maven-2-default", 9 | "enableNuGetSupport" : false, 10 | "enableGemsSupport" : false, 11 | "enableNpmSupport" : false, 12 | "enableBowerSupport" : false, 13 | "enableDebianSupport" : false, 14 | "debianTrivialLayout" : false, 15 | "enablePypiSupport" : false, 16 | "enableDockerSupport" : false, 17 | "dockerApiVersion" : "V1", 18 | "forceDockerAuthentication" : false, 19 | "enableVagrantSupport" : false, 20 | "enableGitLfsSupport" : false, 21 | "url" : "http://jcenter.bintray.com", 22 | "username" : "", 23 | "password" : "", 24 | "handleReleases" : true, 25 | "handleSnapshots" : false, 26 | "suppressPomConsistencyChecks" : true, 27 | "remoteRepoChecksumPolicyType" : "", 28 | "hardFail" : false, 29 | "offline" : false, 30 | "blackedOut" : false, 31 | "storeArtifactsLocally" : true, 32 | "socketTimeoutMillis" : 15000, 33 | "localAddress" : "", 34 | "retrievalCachePeriodSecs" : 43200, 35 | "assumedOfflinePeriodSecs" : 300, 36 | "missedRetrievalCachePeriodSecs" : 7200, 37 | "unusedArtifactsCleanupPeriodHours" : 0, 38 | "fetchJarsEagerly" : false, 39 | "fetchSourcesEagerly" : false, 40 | "shareConfiguration" : false, 41 | "synchronizeProperties" : false, 42 | "maxUniqueSnapshots" : 0, 43 | "propertySets" : [ "artifactory" ], 44 | "archiveBrowsingEnabled" : false, 45 | "listRemoteFolderItems" : true, 46 | "rejectInvalidJars" : false, 47 | "allowAnyHostAuth" : false, 48 | "enableCookieManagement" : false, 49 | "enableTokenAuthentication" : false, 50 | "rclass" : "remote" 51 | } -------------------------------------------------------------------------------- /artifactory.v51/storage.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | // CreatedStorageItem represents a created storage item in artifactory 8 | type CreatedStorageItem struct { 9 | URI string `json:"uri"` 10 | DownloadURI string `json:"downloadUri"` 11 | Repo string `json:"repo"` 12 | Created string `json:"created"` 13 | CreatedBy string `json:"createdBy"` 14 | Size string `json:"size"` 15 | MimeType string `json:"mimeType"` 16 | Checksums ArtifactChecksums `json:"checksums"` 17 | OriginalChecksums ArtifactChecksums `json:"originalChecksums"` 18 | } 19 | 20 | // ArtifactChecksums represents the checksums for an artifact 21 | type ArtifactChecksums struct { 22 | MD5 string `json:"md5"` 23 | SHA1 string `json:"sha1"` 24 | } 25 | 26 | // FileList represents a list of files 27 | type FileList struct { 28 | URI string `json:"uri"` 29 | Created string `json:"created"` 30 | Files []FileListItem `json:"files"` 31 | } 32 | 33 | // FileListItem is an item in a list of files 34 | type FileListItem struct { 35 | URI string `json:"uri"` 36 | Size int `json:"size"` 37 | LastModified string `json:"lastModified"` 38 | Folder bool `json:"folder"` 39 | SHA1 string `json:"sha1"` 40 | } 41 | 42 | // ListFiles lists all files in the specified repo 43 | func (c *Client) ListFiles(repo string) (fileList FileList, err error) { 44 | d, err := c.HTTPRequest(Request{ 45 | Verb: "GET", 46 | Path: "/api/storage/" + repo + "?list&deep=1", 47 | }) 48 | if err != nil { 49 | return fileList, err 50 | } 51 | err = json.Unmarshal(d, &fileList) 52 | return fileList, err 53 | } 54 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/mock/doc.go: -------------------------------------------------------------------------------- 1 | // Package mock provides a system by which it is possible to mock your objects 2 | // and verify calls are happening as expected. 3 | // 4 | // Example Usage 5 | // 6 | // The mock package provides an object, Mock, that tracks activity on another object. It is usually 7 | // embedded into a test object as shown below: 8 | // 9 | // type MyTestObject struct { 10 | // // add a Mock object instance 11 | // mock.Mock 12 | // 13 | // // other fields go here as normal 14 | // } 15 | // 16 | // When implementing the methods of an interface, you wire your functions up 17 | // to call the Mock.Called(args...) method, and return the appropriate values. 18 | // 19 | // For example, to mock a method that saves the name and age of a person and returns 20 | // the year of their birth or an error, you might write this: 21 | // 22 | // func (o *MyTestObject) SavePersonDetails(firstname, lastname string, age int) (int, error) { 23 | // args := o.Called(firstname, lastname, age) 24 | // return args.Int(0), args.Error(1) 25 | // } 26 | // 27 | // The Int, Error and Bool methods are examples of strongly typed getters that take the argument 28 | // index position. Given this argument list: 29 | // 30 | // (12, true, "Something") 31 | // 32 | // You could read them out strongly typed like this: 33 | // 34 | // args.Int(0) 35 | // args.Bool(1) 36 | // args.String(2) 37 | // 38 | // For objects of your own type, use the generic Arguments.Get(index) method and make a type assertion: 39 | // 40 | // return args.Get(0).(*MyObject), args.Get(1).(*AnotherObjectOfMine) 41 | // 42 | // This may cause a panic if the object you are getting is nil (the type assertion will fail), in those 43 | // cases you should check for nil first. 44 | package mock 45 | -------------------------------------------------------------------------------- /src/artifactory.v401/assets/test/remote_repository_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "key" : "jcenter", 3 | "packageType" : "maven", 4 | "description" : "Bintray Central Java repository", 5 | "notes" : "", 6 | "includesPattern" : "**/*", 7 | "excludesPattern" : "", 8 | "repoLayoutRef" : "maven-2-default", 9 | "enableNuGetSupport" : false, 10 | "enableGemsSupport" : false, 11 | "enableNpmSupport" : false, 12 | "enableBowerSupport" : false, 13 | "enableDebianSupport" : false, 14 | "debianTrivialLayout" : false, 15 | "enablePypiSupport" : false, 16 | "enableDockerSupport" : false, 17 | "dockerApiVersion" : "V1", 18 | "forceDockerAuthentication" : false, 19 | "enableVagrantSupport" : false, 20 | "enableGitLfsSupport" : false, 21 | "url" : "http://jcenter.bintray.com", 22 | "username" : "", 23 | "password" : "", 24 | "handleReleases" : true, 25 | "handleSnapshots" : false, 26 | "suppressPomConsistencyChecks" : true, 27 | "remoteRepoChecksumPolicyType" : "", 28 | "hardFail" : false, 29 | "offline" : false, 30 | "blackedOut" : false, 31 | "storeArtifactsLocally" : true, 32 | "socketTimeoutMillis" : 15000, 33 | "localAddress" : "", 34 | "retrievalCachePeriodSecs" : 43200, 35 | "assumedOfflinePeriodSecs" : 300, 36 | "missedRetrievalCachePeriodSecs" : 7200, 37 | "unusedArtifactsCleanupPeriodHours" : 0, 38 | "fetchJarsEagerly" : false, 39 | "fetchSourcesEagerly" : false, 40 | "shareConfiguration" : false, 41 | "synchronizeProperties" : false, 42 | "maxUniqueSnapshots" : 0, 43 | "propertySets" : [ "artifactory" ], 44 | "archiveBrowsingEnabled" : false, 45 | "listRemoteFolderItems" : true, 46 | "rejectInvalidJars" : false, 47 | "allowAnyHostAuth" : false, 48 | "enableCookieManagement" : false, 49 | "enableTokenAuthentication" : false, 50 | "rclass" : "remote" 51 | } -------------------------------------------------------------------------------- /src/artifactory.v491/assets/test/remote_repository_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "key" : "jcenter", 3 | "packageType" : "maven", 4 | "description" : "Bintray Central Java repository", 5 | "notes" : "", 6 | "includesPattern" : "**/*", 7 | "excludesPattern" : "", 8 | "repoLayoutRef" : "maven-2-default", 9 | "enableNuGetSupport" : false, 10 | "enableGemsSupport" : false, 11 | "enableNpmSupport" : false, 12 | "enableBowerSupport" : false, 13 | "enableDebianSupport" : false, 14 | "debianTrivialLayout" : false, 15 | "enablePypiSupport" : false, 16 | "enableDockerSupport" : false, 17 | "dockerApiVersion" : "V1", 18 | "forceDockerAuthentication" : false, 19 | "enableVagrantSupport" : false, 20 | "enableGitLfsSupport" : false, 21 | "url" : "http://jcenter.bintray.com", 22 | "username" : "", 23 | "password" : "", 24 | "handleReleases" : true, 25 | "handleSnapshots" : false, 26 | "suppressPomConsistencyChecks" : true, 27 | "remoteRepoChecksumPolicyType" : "", 28 | "hardFail" : false, 29 | "offline" : false, 30 | "blackedOut" : false, 31 | "storeArtifactsLocally" : true, 32 | "socketTimeoutMillis" : 15000, 33 | "localAddress" : "", 34 | "retrievalCachePeriodSecs" : 43200, 35 | "assumedOfflinePeriodSecs" : 300, 36 | "missedRetrievalCachePeriodSecs" : 7200, 37 | "unusedArtifactsCleanupPeriodHours" : 0, 38 | "fetchJarsEagerly" : false, 39 | "fetchSourcesEagerly" : false, 40 | "shareConfiguration" : false, 41 | "synchronizeProperties" : false, 42 | "maxUniqueSnapshots" : 0, 43 | "propertySets" : [ "artifactory" ], 44 | "archiveBrowsingEnabled" : false, 45 | "listRemoteFolderItems" : true, 46 | "rejectInvalidJars" : false, 47 | "allowAnyHostAuth" : false, 48 | "enableCookieManagement" : false, 49 | "enableTokenAuthentication" : false, 50 | "rclass" : "remote" 51 | } -------------------------------------------------------------------------------- /vendor/gopkg.in/alecthomas/kingpin.v2/usage_test.go: -------------------------------------------------------------------------------- 1 | package kingpin 2 | 3 | import ( 4 | "bytes" 5 | "strings" 6 | "testing" 7 | 8 | "github.com/alecthomas/assert" 9 | ) 10 | 11 | func TestFormatTwoColumns(t *testing.T) { 12 | buf := bytes.NewBuffer(nil) 13 | formatTwoColumns(buf, 2, 2, 20, [][2]string{ 14 | {"--hello", "Hello world help with something that is cool."}, 15 | }) 16 | expected := ` --hello Hello 17 | world 18 | help with 19 | something 20 | that is 21 | cool. 22 | ` 23 | assert.Equal(t, expected, buf.String()) 24 | } 25 | 26 | func TestFormatTwoColumnsWide(t *testing.T) { 27 | samples := [][2]string{ 28 | {strings.Repeat("x", 29), "29 chars"}, 29 | {strings.Repeat("x", 30), "30 chars"}} 30 | buf := bytes.NewBuffer(nil) 31 | formatTwoColumns(buf, 0, 0, 200, samples) 32 | expected := `xxxxxxxxxxxxxxxxxxxxxxxxxxxxx29 chars 33 | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 34 | 30 chars 35 | ` 36 | assert.Equal(t, expected, buf.String()) 37 | } 38 | 39 | func TestHiddenCommand(t *testing.T) { 40 | templates := []struct{ name, template string }{ 41 | {"default", DefaultUsageTemplate}, 42 | {"Compact", CompactUsageTemplate}, 43 | {"Long", LongHelpTemplate}, 44 | {"Man", ManPageTemplate}, 45 | } 46 | 47 | var buf bytes.Buffer 48 | t.Log("1") 49 | 50 | a := New("test", "Test").Writer(&buf).Terminate(nil) 51 | a.Command("visible", "visible") 52 | a.Command("hidden", "hidden").Hidden() 53 | 54 | for _, tp := range templates { 55 | buf.Reset() 56 | a.UsageTemplate(tp.template) 57 | a.Parse(nil) 58 | // a.Parse([]string{"--help"}) 59 | usage := buf.String() 60 | t.Logf("Usage for %s is:\n%s\n", tp.name, usage) 61 | 62 | assert.NotContains(t, usage, "hidden") 63 | assert.Contains(t, usage, "visible") 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /artifactory.v54/assets/test/system_information.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | SYSTEM INFORMATION DUMP 4 | ======================= 5 | 6 | User Info 7 | ======================== 8 | user.country | US 9 | user.dir | / 10 | user.home | /var/opt/jfrog/artifactory 11 | user.language | en 12 | user.name | artifactory 13 | user.timezone | UTC 14 | 15 | Host Info 16 | ======================== 17 | Available Processors | 8 18 | Heap Memory Usage-Commited | 34359738368 19 | Heap Memory Usage-Init | 34359738368 20 | Heap Memory Usage-Max | 34359738368 21 | Heap Memory Usage-Used | 4498467320 22 | Non-Heap Memory Usage-Commited | 216268800 23 | Non-Heap Memory Usage-Init | 2555904 24 | Non-Heap Memory Usage-Max | -1 25 | Non-Heap Memory Usage-Used | 211863008 26 | os.arch | amd64 27 | os.name | Linux 28 | os.version | 3.10.0-514.21.1.el7.x86_64 | Loaded 29 | -------------------------------------------------------------------------------- /vendor/github.com/alecthomas/template/examplefunc_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package template_test 6 | 7 | import ( 8 | "log" 9 | "os" 10 | "strings" 11 | 12 | "github.com/alecthomas/template" 13 | ) 14 | 15 | // This example demonstrates a custom function to process template text. 16 | // It installs the strings.Title function and uses it to 17 | // Make Title Text Look Good In Our Template's Output. 18 | func ExampleTemplate_func() { 19 | // First we create a FuncMap with which to register the function. 20 | funcMap := template.FuncMap{ 21 | // The name "title" is what the function will be called in the template text. 22 | "title": strings.Title, 23 | } 24 | 25 | // A simple template definition to test our function. 26 | // We print the input text several ways: 27 | // - the original 28 | // - title-cased 29 | // - title-cased and then printed with %q 30 | // - printed with %q and then title-cased. 31 | const templateText = ` 32 | Input: {{printf "%q" .}} 33 | Output 0: {{title .}} 34 | Output 1: {{title . | printf "%q"}} 35 | Output 2: {{printf "%q" . | title}} 36 | ` 37 | 38 | // Create a template, add the function map, and parse the text. 39 | tmpl, err := template.New("titleTest").Funcs(funcMap).Parse(templateText) 40 | if err != nil { 41 | log.Fatalf("parsing: %s", err) 42 | } 43 | 44 | // Run the template to verify the output. 45 | err = tmpl.Execute(os.Stdout, "the go programming language") 46 | if err != nil { 47 | log.Fatalf("execution: %s", err) 48 | } 49 | 50 | // Output: 51 | // Input: "the go programming language" 52 | // Output 0: The Go Programming Language 53 | // Output 1: "The Go Programming Language" 54 | // Output 2: "The Go Programming Language" 55 | } 56 | -------------------------------------------------------------------------------- /vendor/github.com/olekukonko/tablewriter/wrap_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Oleku Konko All rights reserved. 2 | // Use of this source code is governed by a MIT 3 | // license that can be found in the LICENSE file. 4 | 5 | // This module is a Table Writer API for the Go Programming Language. 6 | // The protocols were written in pure Go and works on windows and unix systems 7 | 8 | package tablewriter 9 | 10 | import ( 11 | "strings" 12 | "testing" 13 | 14 | "github.com/mattn/go-runewidth" 15 | ) 16 | 17 | var text = "The quick brown fox jumps over the lazy dog." 18 | 19 | func TestWrap(t *testing.T) { 20 | exp := []string{ 21 | "The", "quick", "brown", "fox", 22 | "jumps", "over", "the", "lazy", "dog."} 23 | 24 | got, _ := WrapString(text, 6) 25 | if len(exp) != len(got) { 26 | t.Fail() 27 | } 28 | } 29 | 30 | func TestWrapOneLine(t *testing.T) { 31 | exp := "The quick brown fox jumps over the lazy dog." 32 | words, _ := WrapString(text, 500) 33 | got := strings.Join(words, string(sp)) 34 | if exp != got { 35 | t.Errorf("expected: %q, got: %q", exp, got) 36 | } 37 | } 38 | 39 | func TestUnicode(t *testing.T) { 40 | input := "Česká řeřicha" 41 | var wordsUnicode []string 42 | if runewidth.IsEastAsian() { 43 | wordsUnicode, _ = WrapString(input, 14) 44 | } else { 45 | wordsUnicode, _ = WrapString(input, 13) 46 | } 47 | // input contains 13 (or 14 for CJK) runes, so it fits on one line. 48 | if len(wordsUnicode) != 1 { 49 | t.Fail() 50 | } 51 | } 52 | 53 | func TestDisplayWidth(t *testing.T) { 54 | input := "Česká řeřicha" 55 | want := 13 56 | if runewidth.IsEastAsian() { 57 | want = 14 58 | } 59 | if n := DisplayWidth(input); n != want { 60 | t.Errorf("Wants: %d Got: %d", want, n) 61 | } 62 | input = "\033[43;30m" + input + "\033[00m" 63 | if n := DisplayWidth(input); n != want { 64 | t.Errorf("Wants: %d Got: %d", want, n) 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /vendor/gopkg.in/alecthomas/kingpin.v2/values.json: -------------------------------------------------------------------------------- 1 | [ 2 | {"type": "bool", "parser": "strconv.ParseBool(s)"}, 3 | {"type": "string", "parser": "s, error(nil)", "format": "string(*f.v)", "plural": "Strings"}, 4 | {"type": "uint", "parser": "strconv.ParseUint(s, 0, 64)", "plural": "Uints"}, 5 | {"type": "uint8", "parser": "strconv.ParseUint(s, 0, 8)"}, 6 | {"type": "uint16", "parser": "strconv.ParseUint(s, 0, 16)"}, 7 | {"type": "uint32", "parser": "strconv.ParseUint(s, 0, 32)"}, 8 | {"type": "uint64", "parser": "strconv.ParseUint(s, 0, 64)"}, 9 | {"type": "int", "parser": "strconv.ParseFloat(s, 64)", "plural": "Ints"}, 10 | {"type": "int8", "parser": "strconv.ParseInt(s, 0, 8)"}, 11 | {"type": "int16", "parser": "strconv.ParseInt(s, 0, 16)"}, 12 | {"type": "int32", "parser": "strconv.ParseInt(s, 0, 32)"}, 13 | {"type": "int64", "parser": "strconv.ParseInt(s, 0, 64)"}, 14 | {"type": "float64", "parser": "strconv.ParseFloat(s, 64)"}, 15 | {"type": "float32", "parser": "strconv.ParseFloat(s, 32)"}, 16 | {"name": "Duration", "type": "time.Duration", "no_value_parser": true}, 17 | {"name": "IP", "type": "net.IP", "no_value_parser": true}, 18 | {"name": "TCPAddr", "Type": "*net.TCPAddr", "plural": "TCPList", "no_value_parser": true}, 19 | {"name": "ExistingFile", "Type": "string", "plural": "ExistingFiles", "no_value_parser": true}, 20 | {"name": "ExistingDir", "Type": "string", "plural": "ExistingDirs", "no_value_parser": true}, 21 | {"name": "ExistingFileOrDir", "Type": "string", "plural": "ExistingFilesOrDirs", "no_value_parser": true}, 22 | {"name": "Regexp", "Type": "*regexp.Regexp", "parser": "regexp.Compile(s)"}, 23 | {"name": "ResolvedIP", "Type": "net.IP", "parser": "resolveHost(s)", "help": "Resolve a hostname or IP to an IP."}, 24 | {"name": "HexBytes", "Type": "[]byte", "parser": "hex.DecodeString(s)", "help": "Bytes as a hex string."} 25 | ] 26 | -------------------------------------------------------------------------------- /vendor/github.com/alecthomas/template/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package template_test 6 | 7 | import ( 8 | "log" 9 | "os" 10 | 11 | "github.com/alecthomas/template" 12 | ) 13 | 14 | func ExampleTemplate() { 15 | // Define a template. 16 | const letter = ` 17 | Dear {{.Name}}, 18 | {{if .Attended}} 19 | It was a pleasure to see you at the wedding.{{else}} 20 | It is a shame you couldn't make it to the wedding.{{end}} 21 | {{with .Gift}}Thank you for the lovely {{.}}. 22 | {{end}} 23 | Best wishes, 24 | Josie 25 | ` 26 | 27 | // Prepare some data to insert into the template. 28 | type Recipient struct { 29 | Name, Gift string 30 | Attended bool 31 | } 32 | var recipients = []Recipient{ 33 | {"Aunt Mildred", "bone china tea set", true}, 34 | {"Uncle John", "moleskin pants", false}, 35 | {"Cousin Rodney", "", false}, 36 | } 37 | 38 | // Create a new template and parse the letter into it. 39 | t := template.Must(template.New("letter").Parse(letter)) 40 | 41 | // Execute the template for each recipient. 42 | for _, r := range recipients { 43 | err := t.Execute(os.Stdout, r) 44 | if err != nil { 45 | log.Println("executing template:", err) 46 | } 47 | } 48 | 49 | // Output: 50 | // Dear Aunt Mildred, 51 | // 52 | // It was a pleasure to see you at the wedding. 53 | // Thank you for the lovely bone china tea set. 54 | // 55 | // Best wishes, 56 | // Josie 57 | // 58 | // Dear Uncle John, 59 | // 60 | // It is a shame you couldn't make it to the wedding. 61 | // Thank you for the lovely moleskin pants. 62 | // 63 | // Best wishes, 64 | // Josie 65 | // 66 | // Dear Cousin Rodney, 67 | // 68 | // It is a shame you couldn't make it to the wedding. 69 | // 70 | // Best wishes, 71 | // Josie 72 | } 73 | -------------------------------------------------------------------------------- /cmd/artif-list-users/README.md: -------------------------------------------------------------------------------- 1 | # `artif-list-users` 2 | ``` 3 | usage: artif-list-users [] 4 | 5 | List all users in Artifactory 6 | 7 | Flags: 8 | --help Show help (also see --help-long and --help-man). 9 | -F, --format=table Format to show results [table, csv, list (usernames only - useful for piping)] 10 | --separator="," separator for csv output 11 | --version Show application version. 12 | ``` 13 | 14 | # Examples 15 | 16 | ## Default 17 | `artif-list-users` 18 | 19 | ``` 20 | +-----------------------+------------------------------------------------------------------------------------------+ 21 | | NAME | URI | 22 | +-----------------------+------------------------------------------------------------------------------------------+ 23 | | admin | http://artifactory/artifactory/api/security/users/admin | 24 | | deb | http://artifactory/artifactory/api/security/users/deb | 25 | | ci | http://artifactory/artifactory/api/security/users/ci | 26 | +-----------------------+------------------------------------------------------------------------------------------+ 27 | ``` 28 | 29 | ## csv 30 | `artif-list-users -F csv` 31 | 32 | ``` 33 | admin,http://artifactory/artifactory/api/security/users/admin 34 | dev,http://artifactory/artifactory/api/security/users/deb 35 | ci,http://artifactory/artifactory/api/security/users/ci 36 | ``` 37 | 38 | Optionally you can provide a separator like so: 39 | 40 | `artif-list-users -F csv --separator="|"` (pipe separated) 41 | 42 | ## list 43 | Useful for piping into other scripts such as `artif-get-user` 44 | 45 | `artif-list-users -F list` 46 | 47 | ``` 48 | admin 49 | deb 50 | ci 51 | ``` 52 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/spew/bypasssafe.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015-2016 Dave Collins 2 | // 3 | // Permission to use, copy, modify, and distribute this software for any 4 | // purpose with or without fee is hereby granted, provided that the above 5 | // copyright notice and this permission notice appear in all copies. 6 | // 7 | // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 | // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 | // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 10 | // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 | // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 12 | // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 13 | // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 | 15 | // NOTE: Due to the following build constraints, this file will only be compiled 16 | // when the code is running on Google App Engine, compiled by GopherJS, or 17 | // "-tags safe" is added to the go build command line. The "disableunsafe" 18 | // tag is deprecated and thus should not be used. 19 | // +build js appengine safe disableunsafe 20 | 21 | package spew 22 | 23 | import "reflect" 24 | 25 | const ( 26 | // UnsafeDisabled is a build-time constant which specifies whether or 27 | // not access to the unsafe package is available. 28 | UnsafeDisabled = true 29 | ) 30 | 31 | // unsafeReflectValue typically converts the passed reflect.Value into a one 32 | // that bypasses the typical safety restrictions preventing access to 33 | // unaddressable and unexported data. However, doing this relies on access to 34 | // the unsafe package. This is a stub version which simply returns the passed 35 | // reflect.Value when the unsafe package is not available. 36 | func unsafeReflectValue(v reflect.Value) reflect.Value { 37 | return v 38 | } 39 | -------------------------------------------------------------------------------- /src/artifactory.v401/artifact.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | import ( 4 | "encoding/json" 5 | "io/ioutil" 6 | "os" 7 | "path/filepath" 8 | "strings" 9 | ) 10 | 11 | type FileInfo struct { 12 | Uri string `json:"uri"` 13 | DownloadUri string `json:"downloadUri"` 14 | Repo string `json:"repo"` 15 | Path string `json:"path"` 16 | RemoteUrl string `json:"remoteUrl,omitempty"` 17 | Created string `json:"created"` 18 | CreatedBy string `json:"createdBy"` 19 | LastModified string `json:"lastModified"` 20 | ModifiedBy string `json:"modifiedBy"` 21 | MimeType string `json:"mimeType"` 22 | Size string `json:"size"` 23 | Checksums struct { 24 | SHA1 string `json:"sha1"` 25 | MD5 string `json:"md5"` 26 | } `json:"checksums"` 27 | OriginalChecksums struct { 28 | SHA1 string `json:"sha1"` 29 | MD5 string `json:"md5"` 30 | } `json:"originalChecksums,omitempty"` 31 | } 32 | 33 | func (c *ArtifactoryClient) DeployArtifact(repoKey string, filename string, path string, properties map[string]string) (CreatedStorageItem, error) { 34 | var res CreatedStorageItem 35 | var fileProps []string 36 | var finalUrl string 37 | finalUrl = "/" + repoKey + "/" 38 | if &path != nil { 39 | finalUrl = finalUrl + path 40 | } 41 | baseFile := filepath.Base(filename) 42 | finalUrl = finalUrl + "/" + baseFile 43 | if len(properties) > 0 { 44 | finalUrl = finalUrl + ";" 45 | for k, v := range properties { 46 | fileProps = append(fileProps, k+"="+v) 47 | } 48 | finalUrl = finalUrl + strings.Join(fileProps, ";") 49 | } 50 | data, err := os.Open(filename) 51 | if err != nil { 52 | return res, err 53 | } 54 | defer data.Close() 55 | b, _ := ioutil.ReadAll(data) 56 | d, err := c.Put(finalUrl, string(b), make(map[string]string)) 57 | if err != nil { 58 | return res, err 59 | } else { 60 | e := json.Unmarshal(d, &res) 61 | if e != nil { 62 | return res, e 63 | } else { 64 | return res, nil 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /vendor/github.com/olekukonko/tablewriter/csv2table/csv2table.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/csv" 5 | "flag" 6 | "fmt" 7 | "io" 8 | "os" 9 | "unicode/utf8" 10 | 11 | "github.com/olekukonko/tablewriter" 12 | ) 13 | 14 | var ( 15 | fileName = flag.String("f", "", "Set file with eg. sample.csv") 16 | delimiter = flag.String("d", ",", "Set CSV File delimiter eg. ,|;|\t ") 17 | header = flag.Bool("h", true, "Set header options eg. true|false ") 18 | align = flag.String("a", "none", "Set aligmement with eg. none|left|right|center") 19 | pipe = flag.Bool("p", false, "Suport for Piping from STDIN") 20 | border = flag.Bool("b", true, "Enable / disable table border") 21 | ) 22 | 23 | func main() { 24 | flag.Parse() 25 | fmt.Println() 26 | if *pipe || hasArg("-p") { 27 | process(os.Stdin) 28 | } else { 29 | if *fileName == "" { 30 | fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0]) 31 | flag.PrintDefaults() 32 | fmt.Println() 33 | os.Exit(1) 34 | } 35 | processFile() 36 | } 37 | fmt.Println() 38 | } 39 | 40 | func hasArg(name string) bool { 41 | for _, v := range os.Args { 42 | if name == v { 43 | return true 44 | } 45 | } 46 | return false 47 | } 48 | func processFile() { 49 | r, err := os.Open(*fileName) 50 | if err != nil { 51 | exit(err) 52 | } 53 | defer r.Close() 54 | process(r) 55 | } 56 | func process(r io.Reader) { 57 | csvReader := csv.NewReader(r) 58 | rune, size := utf8.DecodeRuneInString(*delimiter) 59 | if size == 0 { 60 | rune = ',' 61 | } 62 | csvReader.Comma = rune 63 | 64 | table, err := tablewriter.NewCSVReader(os.Stdout, csvReader, *header) 65 | 66 | if err != nil { 67 | exit(err) 68 | } 69 | 70 | switch *align { 71 | case "left": 72 | table.SetAlignment(tablewriter.ALIGN_LEFT) 73 | case "right": 74 | table.SetAlignment(tablewriter.ALIGN_RIGHT) 75 | case "center": 76 | table.SetAlignment(tablewriter.ALIGN_CENTER) 77 | } 78 | table.SetBorder(*border) 79 | table.Render() 80 | } 81 | 82 | func exit(err error) { 83 | fmt.Fprintf(os.Stderr, "#Error : %s", err) 84 | os.Exit(1) 85 | } 86 | -------------------------------------------------------------------------------- /Gopkg.lock: -------------------------------------------------------------------------------- 1 | # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. 2 | 3 | 4 | [[projects]] 5 | branch = "master" 6 | name = "github.com/alecthomas/template" 7 | packages = [".","parse"] 8 | revision = "a0175ee3bccc567396460bf5acd36800cb10c49c" 9 | 10 | [[projects]] 11 | branch = "master" 12 | name = "github.com/alecthomas/units" 13 | packages = ["."] 14 | revision = "2efee857e7cfd4f3d0138cc3cbb1b4966962b93a" 15 | 16 | [[projects]] 17 | name = "github.com/coreos/go-semver" 18 | packages = ["semver"] 19 | revision = "8ab6407b697782a06568d4b7f1db25550ec2e4c6" 20 | version = "v0.2.0" 21 | 22 | [[projects]] 23 | name = "github.com/davecgh/go-spew" 24 | packages = ["spew"] 25 | revision = "346938d642f2ec3594ed81d874461961cd0faa76" 26 | version = "v1.1.0" 27 | 28 | [[projects]] 29 | branch = "master" 30 | name = "github.com/lusis/outputter" 31 | packages = ["."] 32 | revision = "6a36c1d04ef3d5fcf98096a83ddded6f6ebf87d2" 33 | 34 | [[projects]] 35 | name = "github.com/mattn/go-runewidth" 36 | packages = ["."] 37 | revision = "9e777a8366cce605130a531d2cd6363d07ad7317" 38 | version = "v0.0.2" 39 | 40 | [[projects]] 41 | branch = "master" 42 | name = "github.com/olekukonko/tablewriter" 43 | packages = ["."] 44 | revision = "a7a4c189eb47ed33ce7b35f2880070a0c82a67d4" 45 | 46 | [[projects]] 47 | name = "github.com/pmezard/go-difflib" 48 | packages = ["difflib"] 49 | revision = "792786c7400a136282c1664665ae0a8db921c6c2" 50 | version = "v1.0.0" 51 | 52 | [[projects]] 53 | name = "github.com/stretchr/testify" 54 | packages = ["assert"] 55 | revision = "69483b4bd14f5845b5a1e55bca19e954e827f1d0" 56 | version = "v1.1.4" 57 | 58 | [[projects]] 59 | name = "gopkg.in/alecthomas/kingpin.v2" 60 | packages = ["."] 61 | revision = "1087e65c9441605df944fb12c33f0fe7072d18ca" 62 | version = "v2.2.5" 63 | 64 | [solve-meta] 65 | analyzer-name = "dep" 66 | analyzer-version = 1 67 | inputs-digest = "a4458acf173835f512b939a62c20f6140faa26ddf0519a3f6cee0f918e8cdd28" 68 | solver-name = "gps-cdcl" 69 | solver-version = 1 70 | -------------------------------------------------------------------------------- /artifactory.v54/permissions_targets.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | // PermissionTarget represents the json returned by Artifactory for a permission target 8 | type PermissionTarget struct { 9 | Name string `json:"name"` 10 | URI string `json:"uri"` 11 | } 12 | 13 | // PermissionTargetDetails represents the json returned by Artifactory for permission target details 14 | type PermissionTargetDetails struct { 15 | Name string `json:"name,omitempty"` 16 | IncludesPattern string `json:"includesPattern,omitempty"` 17 | ExcludesPattern string `json:"excludesPattern,omitempty"` 18 | Repositories []string `json:"repositories,omitempty"` 19 | Principals Principals `json:"principals,omitempty"` 20 | } 21 | 22 | // Principals represents the json response for principals in Artifactory 23 | type Principals struct { 24 | Users map[string][]string `json:"users"` 25 | Groups map[string][]string `json:"groups"` 26 | } 27 | 28 | // GetPermissionTargets returns all permission targets 29 | func (c *Client) GetPermissionTargets() ([]PermissionTarget, error) { 30 | var res []PermissionTarget 31 | d, err := c.Get("/api/security/permissions", make(map[string]string)) 32 | if err != nil { 33 | return res, err 34 | } 35 | err = json.Unmarshal(d, &res) 36 | 37 | return res, err 38 | } 39 | 40 | // GetPermissionTargetDetails returns the details of the provided permission target 41 | func (c *Client) GetPermissionTargetDetails(key string, q map[string]string) (PermissionTargetDetails, error) { 42 | var res PermissionTargetDetails 43 | d, err := c.Get("/api/security/permissions/"+key, q) 44 | if err != nil { 45 | return res, err 46 | } 47 | err = json.Unmarshal(d, &res) 48 | 49 | return res, err 50 | } 51 | 52 | // CreatePermissionTarget creates the named permission target 53 | func (c *Client) CreatePermissionTarget(key string, p PermissionTargetDetails, q map[string]string) error { 54 | j, err := json.Marshal(p) 55 | if err != nil { 56 | return err 57 | } 58 | _, err = c.Put("/api/security/permissions/"+key, j, q) 59 | return err 60 | } 61 | -------------------------------------------------------------------------------- /artifactory.v54/api_test.go: -------------------------------------------------------------------------------- 1 | package artifactory 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "net/http" 7 | "net/http/httptest" 8 | "net/url" 9 | "testing" 10 | 11 | "github.com/stretchr/testify/assert" 12 | ) 13 | 14 | func TestGetUserAPIKey(t *testing.T) { 15 | apiKey := UserAPIKey{ 16 | APIKey: "testAPIKey", 17 | } 18 | body, _ := json.Marshal(apiKey) 19 | server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 20 | w.WriteHeader(200) 21 | w.Header().Set("Content-Type", "application/json") 22 | fmt.Fprintf(w, string(body)) 23 | })) 24 | defer server.Close() 25 | 26 | transport := &http.Transport{ 27 | Proxy: func(req *http.Request) (*url.URL, error) { 28 | return url.Parse(server.URL) 29 | }, 30 | } 31 | 32 | conf := &ClientConfig{ 33 | BaseURL: "http://127.0.0.1:8080/", 34 | Username: "username", 35 | Password: "password", 36 | VerifySSL: false, 37 | Transport: transport, 38 | } 39 | 40 | client := NewClient(conf) 41 | key, err := client.GetUserAPIKey() 42 | assert.NoError(t, err, "should not return an error") 43 | assert.Equal(t, "testAPIKey", key, "key should be testAPIKey") 44 | } 45 | 46 | func TestCreateUserAPIKey(t *testing.T) { 47 | apiKey := UserAPIKey{ 48 | APIKey: "testAPIKey", 49 | } 50 | body, _ := json.Marshal(apiKey) 51 | server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 52 | w.WriteHeader(200) 53 | w.Header().Set("Content-Type", "application/json") 54 | fmt.Fprintf(w, string(body)) 55 | })) 56 | defer server.Close() 57 | 58 | transport := &http.Transport{ 59 | Proxy: func(req *http.Request) (*url.URL, error) { 60 | return url.Parse(server.URL) 61 | }, 62 | } 63 | 64 | conf := &ClientConfig{ 65 | BaseURL: "http://127.0.0.1:8080/", 66 | Username: "username", 67 | Password: "password", 68 | VerifySSL: false, 69 | Transport: transport, 70 | } 71 | 72 | client := NewClient(conf) 73 | key, err := client.CreateUserAPIKey() 74 | assert.NoError(t, err, "should not return an error") 75 | assert.Equal(t, "testAPIKey", key, "key should be testAPIKey") 76 | } 77 | -------------------------------------------------------------------------------- /vendor/gopkg.in/alecthomas/kingpin.v2/completions_test.go: -------------------------------------------------------------------------------- 1 | package kingpin 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/alecthomas/assert" 7 | ) 8 | 9 | func TestResolveWithBuiltin(t *testing.T) { 10 | a := completionsMixin{} 11 | 12 | hintAction1 := func() []string { 13 | return []string{"opt1", "opt2"} 14 | } 15 | hintAction2 := func() []string { 16 | return []string{"opt3", "opt4"} 17 | } 18 | 19 | a.builtinHintActions = []HintAction{hintAction1, hintAction2} 20 | 21 | args := a.resolveCompletions() 22 | assert.Equal(t, []string{"opt1", "opt2", "opt3", "opt4"}, args) 23 | } 24 | 25 | func TestResolveWithUser(t *testing.T) { 26 | a := completionsMixin{} 27 | hintAction1 := func() []string { 28 | return []string{"opt1", "opt2"} 29 | } 30 | hintAction2 := func() []string { 31 | return []string{"opt3", "opt4"} 32 | } 33 | 34 | a.hintActions = []HintAction{hintAction1, hintAction2} 35 | 36 | args := a.resolveCompletions() 37 | assert.Equal(t, []string{"opt1", "opt2", "opt3", "opt4"}, args) 38 | } 39 | 40 | func TestResolveWithCombination(t *testing.T) { 41 | a := completionsMixin{} 42 | builtin := func() []string { 43 | return []string{"opt1", "opt2"} 44 | } 45 | user := func() []string { 46 | return []string{"opt3", "opt4"} 47 | } 48 | 49 | a.builtinHintActions = []HintAction{builtin} 50 | a.hintActions = []HintAction{user} 51 | 52 | args := a.resolveCompletions() 53 | // User provided args take preference over builtin (enum-defined) args. 54 | assert.Equal(t, []string{"opt3", "opt4"}, args) 55 | } 56 | 57 | func TestAddHintAction(t *testing.T) { 58 | a := completionsMixin{} 59 | hintFunc := func() []string { 60 | return []string{"opt1", "opt2"} 61 | } 62 | a.addHintAction(hintFunc) 63 | 64 | args := a.resolveCompletions() 65 | assert.Equal(t, []string{"opt1", "opt2"}, args) 66 | } 67 | 68 | func TestAddHintActionBuiltin(t *testing.T) { 69 | a := completionsMixin{} 70 | hintFunc := func() []string { 71 | return []string{"opt1", "opt2"} 72 | } 73 | 74 | a.addHintActionBuiltin(hintFunc) 75 | 76 | args := a.resolveCompletions() 77 | assert.Equal(t, []string{"opt1", "opt2"}, args) 78 | } 79 | -------------------------------------------------------------------------------- /vendor/github.com/olekukonko/tablewriter/util.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Oleku Konko All rights reserved. 2 | // Use of this source code is governed by a MIT 3 | // license that can be found in the LICENSE file. 4 | 5 | // This module is a Table Writer API for the Go Programming Language. 6 | // The protocols were written in pure Go and works on windows and unix systems 7 | 8 | package tablewriter 9 | 10 | import ( 11 | "math" 12 | "regexp" 13 | "strings" 14 | 15 | "github.com/mattn/go-runewidth" 16 | ) 17 | 18 | var ansi = regexp.MustCompile("\033\\[(?:[0-9]{1,3}(?:;[0-9]{1,3})*)?[m|K]") 19 | 20 | func DisplayWidth(str string) int { 21 | return runewidth.StringWidth(ansi.ReplaceAllLiteralString(str, "")) 22 | } 23 | 24 | // Simple Condition for string 25 | // Returns value based on condition 26 | func ConditionString(cond bool, valid, inValid string) string { 27 | if cond { 28 | return valid 29 | } 30 | return inValid 31 | } 32 | 33 | // Format Table Header 34 | // Replace _ , . and spaces 35 | func Title(name string) string { 36 | name = strings.Replace(name, "_", " ", -1) 37 | name = strings.Replace(name, ".", " ", -1) 38 | name = strings.TrimSpace(name) 39 | return strings.ToUpper(name) 40 | } 41 | 42 | // Pad String 43 | // Attempts to play string in the center 44 | func Pad(s, pad string, width int) string { 45 | gap := width - DisplayWidth(s) 46 | if gap > 0 { 47 | gapLeft := int(math.Ceil(float64(gap / 2))) 48 | gapRight := gap - gapLeft 49 | return strings.Repeat(string(pad), gapLeft) + s + strings.Repeat(string(pad), gapRight) 50 | } 51 | return s 52 | } 53 | 54 | // Pad String Right position 55 | // This would pace string at the left side fo the screen 56 | func PadRight(s, pad string, width int) string { 57 | gap := width - DisplayWidth(s) 58 | if gap > 0 { 59 | return s + strings.Repeat(string(pad), gap) 60 | } 61 | return s 62 | } 63 | 64 | // Pad String Left position 65 | // This would pace string at the right side fo the screen 66 | func PadLeft(s, pad string, width int) string { 67 | gap := width - DisplayWidth(s) 68 | if gap > 0 { 69 | return strings.Repeat(string(pad), gap) + s 70 | } 71 | return s 72 | } 73 | --------------------------------------------------------------------------------