Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Token validation #186

Merged
merged 11 commits into from
Sep 11, 2023
Merged

Token validation #186

merged 11 commits into from
Sep 11, 2023

Conversation

tiulpin
Copy link
Member

@tiulpin tiulpin commented Sep 7, 2023

Pull Request Details

Working together with @KoT9R.

Added validation of qodana clout token to avoid cases where the token is incorrect, and the analysis is in progress.

Description

options. go: refactor code, move steps of getting token into functions LGTM

license. go: added new warning message if the token is not correct

qodana_cloud_client.go: HTTP client, which requests qodana cloud to validate the token

validation_token_test.go: some tests

Motivation and Context

These changes allow you to avoid situations when you have a big project in which analyzing takes a lot of time, and in the end, you get a message that the report can't be sent to the cloud because it is not corrected 😠

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My commit messages are styled with gitmoji
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@github-actions
Copy link

github-actions bot commented Sep 8, 2023

Qodana for Go

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Dependencies licenses

Third-party software list

This page lists the third-party software dependencies used in project

Dependency Version Licenses
atomicgo.dev/assert v0.0.2 MIT
atomicgo.dev/cursor v0.2.0 MIT
atomicgo.dev/keyboard v0.2.9 MIT
atomicgo.dev/schedule v0.1.0 MIT
cloud.google.com/go/bigquery v1.8.0 Apache-2.0
cloud.google.com/go/compute/metadata v0.2.3 Apache-2.0
cloud.google.com/go/compute v1.19.0 Apache-2.0
cloud.google.com/go/datastore v1.1.0 Apache-2.0
cloud.google.com/go/firestore v1.9.0 Apache-2.0
cloud.google.com/go/longrunning v0.4.1 Apache-2.0
cloud.google.com/go/pubsub v1.3.1 Apache-2.0
cloud.google.com/go/storage v1.14.0 Apache-2.0
cloud.google.com/go v0.110.0 Apache-2.0
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9 BSD-3-Clause
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 MIT
github.com/BurntSushi/toml v0.3.1 MIT
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 BSD-3-Clause
github.com/MarvinJWendt/testza v0.5.2 MIT
github.com/Microsoft/go-winio v0.6.1 MIT
github.com/alessio/shellescape v1.4.1 MIT
github.com/apparentlymart/go-textseg/v13 v13.0.0 MIT
Unicode-DFS-2016
github.com/armon/go-metrics v0.4.0 MIT
github.com/atomicgo/cursor v0.0.1 MIT
github.com/boyter/scc/v3 v3.1.0 MIT
Unlicense
github.com/census-instrumentation/opencensus-proto v0.2.1 Apache-2.0
github.com/chzyer/logex v1.1.10 MIT
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e MIT
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 MIT
github.com/client9/misspell v0.3.4 BSD-3-Clause
MIT
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403 Apache-2.0
github.com/containerd/console v1.0.3 Apache-2.0
github.com/coreos/go-semver v0.3.0 Apache-2.0
github.com/coreos/go-systemd/v22 v22.3.2 Apache-2.0
github.com/cpuguy83/go-md2man/v2 v2.0.2 MIT
github.com/creack/pty v1.1.18 MIT
github.com/cucumber/ci-environment/go v0.0.0-20230723160303-a2dce81f299c MIT
github.com/danieljoos/wincred v1.2.0 MIT
github.com/davecgh/go-spew v1.1.1 ISC
github.com/dbaggerman/cuba v0.3.2 MIT
github.com/docker/cli v20.10.23+incompatible Apache-2.0
MIT
github.com/docker/distribution v2.8.2+incompatible Apache-2.0
github.com/docker/docker-credential-helpers v0.8.0 MIT
github.com/docker/docker v20.10.23+incompatible Apache-2.0
MIT
github.com/docker/go-connections v0.4.0 Apache-2.0
github.com/docker/go-units v0.5.0 Apache-2.0
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad Apache-2.0
github.com/envoyproxy/protoc-gen-validate v0.1.0 Apache-2.0
github.com/fatih/color v1.13.0 MIT
github.com/frankban/quicktest v1.14.4 MIT
github.com/fsnotify/fsnotify v1.6.0 BSD-3-Clause
github.com/go-enry/go-enry/v2 v2.8.4 Apache-2.0
github.com/go-enry/go-oniguruma v1.2.1 MIT
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4 BSD-3-Clause
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 BSD-3-Clause
github.com/go-ole/go-ole v1.2.6 MIT
github.com/godbus/dbus/v5 v5.1.0 BSD-2-Clause
github.com/gogo/protobuf v1.3.2 BSD-3-Clause
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b Apache-2.0
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da Apache-2.0
github.com/golang/mock v1.4.4 Apache-2.0
github.com/golang/protobuf v1.5.3 BSD-3-Clause
github.com/google/btree v1.0.0 Apache-2.0
github.com/google/go-cmp v0.5.9 BSD-3-Clause
github.com/google/gofuzz v1.0.0 Apache-2.0
github.com/google/martian/v3 v3.1.0 Apache-2.0
github.com/google/martian v2.1.0+incompatible Apache-2.0
github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2 Apache-2.0
github.com/google/renameio v0.1.0 Apache-2.0
github.com/google/s2a-go v0.1.3 Apache-2.0
github.com/google/uuid v1.3.1 BSD-3-Clause
github.com/googleapis/enterprise-certificate-proxy v0.2.3 Apache-2.0
github.com/googleapis/gax-go/v2 v2.8.0 BSD-3-Clause
github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8 Apache-2.0
github.com/gookit/color v1.5.4 MIT
github.com/hashicorp/consul/api v1.20.0 MPL-2.0
github.com/hashicorp/go-cleanhttp v0.5.2 MPL-2.0
github.com/hashicorp/go-hclog v1.2.0 MIT
github.com/hashicorp/go-immutable-radix v1.3.1 MPL-2.0
github.com/hashicorp/go-rootcerts v1.0.2 MPL-2.0
github.com/hashicorp/golang-lru v0.5.4 MPL-2.0
github.com/hashicorp/hcl v1.0.0 MPL-2.0
github.com/hashicorp/serf v0.10.1 MPL-2.0
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639 BSD-3-Clause
github.com/inconshreveable/mousetrap v1.1.0 Apache-2.0
github.com/json-iterator/go v1.1.12 MIT
github.com/jstemmer/go-junit-report v0.9.1 MIT
github.com/karrick/godirwalk v1.10.12 BSD-2-Clause
github.com/kisielk/errcheck v1.5.0 MIT
github.com/kisielk/gotool v1.0.0 BSD-3-Clause
MIT
github.com/klauspost/cpuid/v2 v2.2.3 MIT
github.com/kr/fs v0.1.0 BSD-3-Clause
github.com/kr/pretty v0.3.1 MIT
github.com/kr/pty v1.1.1 MIT
github.com/kr/text v0.2.0 MIT
github.com/liamg/clinch v1.6.4 Unlicense
github.com/liamg/tml v0.3.0 Unlicense
github.com/lithammer/fuzzysearch v1.1.8 MIT
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 BSD-3-Clause
github.com/magiconair/properties v1.8.7 BSD-2-Clause
github.com/mattn/go-colorable v0.1.12 MIT
github.com/mattn/go-isatty v0.0.19 MIT
github.com/mattn/go-runewidth v0.0.15 MIT
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 Apache-2.0
github.com/mitchellh/go-homedir v1.1.0 MIT
github.com/mitchellh/mapstructure v1.5.0 MIT
github.com/moby/term v0.5.0 Apache-2.0
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd Apache-2.0
github.com/modern-go/reflect2 v1.0.2 Apache-2.0
github.com/morikuni/aec v1.0.0 MIT
github.com/opencontainers/go-digest v1.0.0 Apache-2.0
CC-BY-SA-4.0
github.com/opencontainers/image-spec v1.0.2 Apache-2.0
github.com/otiai10/copy v1.12.0 MIT
github.com/otiai10/mint v1.5.1 MIT
github.com/owenrumney/go-sarif/v2 v2.2.0 Unlicense
github.com/owenrumney/go-sarif v1.1.1 Unlicense
github.com/pelletier/go-toml/v2 v2.0.8 MIT
github.com/pkg/errors v0.9.1 BSD-2-Clause
github.com/pkg/profile v1.3.0 BSD-2-Clause
github.com/pkg/sftp v1.13.1 BSD-2-Clause
github.com/pkg/term v0.0.0-20190109203006-aa71e9d9e942 BSD-2-Clause
github.com/pmezard/go-difflib v1.0.0 BSD-3-Clause
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c MIT
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 Apache-2.0
github.com/pterm/pterm v0.12.66 MIT
github.com/rivo/uniseg v0.4.4 MIT
github.com/rogpeppe/go-internal v1.9.0 BSD-3-Clause
github.com/russross/blackfriday/v2 v2.1.0 BSD-2-Clause
github.com/sagikazarmark/crypt v0.10.0 MIT
github.com/sergi/go-diff v1.2.0 MIT
github.com/shirou/gopsutil/v3 v3.23.8 BSD-3-Clause
github.com/shoenig/go-m1cpu v0.1.6 MPL-2.0
github.com/shoenig/test v0.6.4 MPL-2.0
github.com/sirupsen/logrus v1.9.3 MIT
github.com/spf13/afero v1.9.5 Apache-2.0
github.com/spf13/cast v1.5.1 MIT
github.com/spf13/cobra v1.7.0 Apache-2.0
github.com/spf13/jwalterweatherman v1.1.0 MIT
github.com/spf13/pflag v1.0.5 BSD-3-Clause
github.com/spf13/viper v1.16.0 MIT
github.com/stretchr/objx v0.5.0 MIT
github.com/stretchr/testify v1.8.4 MIT
github.com/subosito/gotenv v1.4.2 MIT
github.com/tklauser/go-sysconf v0.3.12 BSD-3-Clause
github.com/tklauser/numcpus v0.6.1 Apache-2.0
github.com/vmihailenco/msgpack/v4 v4.3.12 BSD-2-Clause
github.com/vmihailenco/tagparser v0.1.1 BSD-2-Clause
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e MIT
github.com/yuin/goldmark v1.4.13 MIT
github.com/yusufpapurcu/wmi v1.2.3 MIT
github.com/zalando/go-keyring v0.2.3 MIT
github.com/zclconf/go-cty v1.10.0 MIT
go.etcd.io/etcd/api/v3 v3.5.9 Apache-2.0
go.etcd.io/etcd/client/pkg/v3 v3.5.9 Apache-2.0
go.etcd.io/etcd/client/v2 v2.305.7 Apache-2.0
go.etcd.io/etcd/client/v3 v3.5.9 Apache-2.0
go.opencensus.io v0.24.0 Apache-2.0
go.uber.org/atomic v1.9.0 MIT
go.uber.org/multierr v1.8.0 MIT
go.uber.org/zap v1.21.0 MIT
golang.org/x/crypto v0.9.0 BSD-3-Clause
golang.org/x/exp v0.0.0-20220909182711-5c715a9e8561 BSD-3-Clause
golang.org/x/image v0.0.0-20190802002840-cff245a6509b BSD-3-Clause
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 BSD-3-Clause
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 BSD-3-Clause
golang.org/x/mod v0.8.0 BSD-3-Clause
golang.org/x/net v0.10.0 BSD-3-Clause
golang.org/x/oauth2 v0.7.0 BSD-3-Clause
golang.org/x/sync v0.1.0 BSD-3-Clause
golang.org/x/sys v0.11.0 BSD-3-Clause
golang.org/x/term v0.11.0 BSD-3-Clause
golang.org/x/text v0.12.0 BSD-3-Clause
golang.org/x/time v0.1.0 BSD-3-Clause
golang.org/x/tools v0.6.0 BSD-3-Clause
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 BSD-3-Clause
google.golang.org/api v0.122.0 BSD-3-Clause
google.golang.org/appengine v1.6.7 Apache-2.0
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 Apache-2.0
google.golang.org/grpc v1.55.0 Apache-2.0
google.golang.org/protobuf v1.30.0 BSD-3-Clause
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 BSD-2-Clause
gopkg.in/errgo.v2 v2.1.0 BSD-3-Clause
gopkg.in/ini.v1 v1.67.0 Apache-2.0
gopkg.in/yaml.v2 v2.2.8 Apache-2.0
MIT
gopkg.in/yaml.v3 v3.0.1 Apache-2.0
MIT
gotest.tools/v3 v3.5.0 Apache-2.0
honnef.co/go/tools v0.0.1-2020.1.4 MIT
rsc.io/binaryregexp v0.2.0 BSD-3-Clause
rsc.io/quote/v3 v3.1.0 BSD-3-Clause
rsc.io/sampler v1.3.0 BSD-3-Clause
Contact Qodana team

Contact us at [email protected]

@tiulpin tiulpin merged commit 31748bc into main Sep 11, 2023
7 checks passed
@tiulpin tiulpin deleted the token-validation branch September 11, 2023 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants