diff --git a/.github/workflows/item_scan.yml b/.github/workflows/item_scan.yml new file mode 100644 index 000000000000..cc4abf951e85 --- /dev/null +++ b/.github/workflows/item_scan.yml @@ -0,0 +1,65 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + - uses: actions/setup-ruby@v1 + with: + ruby-version: '2.7' # Version range or exact version of a Ruby version to use, using semvers version range syntax. + - run: ruby -v + # - name: Demo Docker + # uses: docker://ruby:2.7 + # with: + # first_name: Mona + # middle_name: The + # last_name: Octocat + # run: | + # echo $MY_VAR $FIRST_NAME $MIDDLE_NAME $LAST_NAME + # ruby -v > ruby-demo.txt + + # Runs a single command using the runners shell + - name: Scan Code + run: git grep -n HIPSPEC- > report.txt + + - name: Save Scan As Artifact + uses: actions/upload-artifact@v2 + with: + name: report + path: report.txt + + hipspec_scan_job: + runs-on: ubuntu-latest + name: A job to Scan Product Features From Repos + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: HipSpec Scan + id: hipspec-scan + uses: HipSpec/hipspec-scan@develop + env: + HIPSPEC_WEBHOOK: ${{ secrets.HIPSPEC_WEBHOOK }} + # with: + # who-to-greet: 'Gus the Octocat' + # Use the output from the `hello` step + # - name: Get the output time + # run: echo "The time was ${{ steps.hello.outputs.time }}" + + \ No newline at end of file diff --git a/.gitignore b/.gitignore index 449fd2a33324..d77855a3afa3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +*.rb *.class *.iml *.jar diff --git a/README.md b/README.md index 810203818495..b797f05bf330 100644 --- a/README.md +++ b/README.md @@ -125,3 +125,6 @@ Unless otherwise noted, all Metabase source files are made available under the t See [LICENSE.txt](https://github.com/metabase/metabase/blob/master/LICENSE.txt) for details and exceptions. Unless otherwise noted, all files © 2019 Metabase, Inc. + +# Sample +Touching project. \ No newline at end of file diff --git a/frontend/src/metabase/alert/alert.js b/frontend/src/metabase/alert/alert.js index 2fc3b7f2ca22..bf8893d7a46e 100644 --- a/frontend/src/metabase/alert/alert.js +++ b/frontend/src/metabase/alert/alert.js @@ -111,6 +111,8 @@ export const updateAlert = alert => { export const UNSUBSCRIBE_FROM_ALERT = "metabase/alerts/UNSUBSCRIBE_FROM_ALERT"; export const UNSUBSCRIBE_FROM_ALERT_CLEANUP = "metabase/alerts/UNSUBSCRIBE_FROM_ALERT_CLEANUP"; + +// HIPSPEC-GZHQERJ const unsubscribeFromAlertRequest = new RestfulRequest({ endpoint: AlertApi.unsubscribe, actionPrefix: UNSUBSCRIBE_FROM_ALERT, diff --git a/frontend/src/metabase/components/UserAvatar.jsx b/frontend/src/metabase/components/UserAvatar.jsx index f0ac0ecaa3c9..7c4d4a0f0156 100644 --- a/frontend/src/metabase/components/UserAvatar.jsx +++ b/frontend/src/metabase/components/UserAvatar.jsx @@ -1,5 +1,5 @@ /* @flow */ - +// HIPSPEC-9JF7M58 import styled from "styled-components"; import { Flex } from "grid-styled"; import { height } from "styled-system"; diff --git a/frontend/src/metabase/entities/containers/EntityListLoader.jsx b/frontend/src/metabase/entities/containers/EntityListLoader.jsx index 6c4eaf74758f..eb626865d1d9 100644 --- a/frontend/src/metabase/entities/containers/EntityListLoader.jsx +++ b/frontend/src/metabase/entities/containers/EntityListLoader.jsx @@ -47,6 +47,8 @@ const getEntityQuery = (state, props) => // object is created. This works because entityQuery must be JSON serializable // NOTE: Technically leaks a small amount of memory because it uses an unbounded // memoization cache, but that's probably ok. +// HIPSPEC-6KR3TZB + const getMemoizedEntityQuery = createMemoizedSelector( [getEntityQuery], entityQuery => entityQuery, diff --git a/frontend/src/metabase/entities/users/forms.js b/frontend/src/metabase/entities/users/forms.js index c950cc47e149..9f6f81558c97 100644 --- a/frontend/src/metabase/entities/users/forms.js +++ b/frontend/src/metabase/entities/users/forms.js @@ -29,6 +29,7 @@ const DETAILS_FORM_FIELDS: () => FormFieldDefinition[] = () => [ }, ]; +// HIPSPEC-KDECLSP const LOCALE_FIELD: FormFieldDefinition = { name: "locale", title: t`Language`, @@ -42,6 +43,7 @@ const LOCALE_FIELD: FormFieldDefinition = { ].map(([code, name]) => ({ name, value: code })), }; +// HIPSPEC-VB4X2RW const PASSWORD_FORM_FIELDS: () => FormFieldDefinition[] = () => [ { name: "password", diff --git a/frontend/src/metabase/lib/settings.js b/frontend/src/metabase/lib/settings.js index 8f0165feb5d6..03baee22b6ac 100644 --- a/frontend/src/metabase/lib/settings.js +++ b/frontend/src/metabase/lib/settings.js @@ -95,7 +95,7 @@ class Settings { ssoEnabled() { return this.get("google-auth-client-id") != null; } - + // HIPSPEC-8I2UMLY ldapEnabled() { return this.get("ldap-configured?"); } diff --git a/frontend/src/metabase/plugins/builtin/auth/ldap.js b/frontend/src/metabase/plugins/builtin/auth/ldap.js index 5ff2f8e7fd51..9a24bbc27cfa 100644 --- a/frontend/src/metabase/plugins/builtin/auth/ldap.js +++ b/frontend/src/metabase/plugins/builtin/auth/ldap.js @@ -7,6 +7,7 @@ import SettingsLdapForm from "metabase/admin/settings/components/SettingsLdapFor import AuthenticationOption from "metabase/admin/settings/components/widgets/AuthenticationOption"; import GroupMappingsWidget from "metabase/admin/settings/components/widgets/GroupMappingsWidget"; +// HIPSPEC-8I2UMLY PLUGIN_ADMIN_SETTINGS_UPDATES.push( sections => updateIn(sections, ["authentication", "settings"], settings => [ diff --git a/frontend/src/metabase/services.js b/frontend/src/metabase/services.js index 40a5e8176d48..7fec149b6432 100644 --- a/frontend/src/metabase/services.js +++ b/frontend/src/metabase/services.js @@ -117,6 +117,7 @@ export const SlackApi = { updateSettings: PUT("/api/slack/settings"), }; +// HIPSPEC-8I2UMLY export const LdapApi = { updateSettings: PUT("/api/ldap/settings"), }; diff --git a/src/metabase/api/alert.clj b/src/metabase/api/alert.clj index c0075d653902..41faac68ced8 100644 --- a/src/metabase/api/alert.clj +++ b/src/metabase/api/alert.clj @@ -192,6 +192,7 @@ ;; No need to unsubscribe if we're just going to delete the Pulse (db/delete! Pulse :id id) ;; There are other receipieints, remove current user only + ;; HIPSPEC-GZHQERJ (pulse/unsubscribe-from-alert! id api/*current-user-id*)) ;; Send emails letting people know they have been unsubscribe (when (email/email-configured?) diff --git a/src/metabase/api/ldap.clj b/src/metabase/api/ldap.clj index ae45645b8572..7b4ab8a1de92 100644 --- a/src/metabase/api/ldap.clj +++ b/src/metabase/api/ldap.clj @@ -1,3 +1,4 @@ +;; HIPSPEC-8I2UMLY (ns metabase.api.ldap "/api/ldap endpoints" (:require [clojure.set :as set] diff --git a/src/metabase/api/session.clj b/src/metabase/api/session.clj index 24bcbdbdf67f..590083a2b38b 100644 --- a/src/metabase/api/session.clj +++ b/src/metabase/api/session.clj @@ -67,6 +67,8 @@ (def ^:private password-fail-snippet (deferred-tru "did not match stored password")) (s/defn ^:private ldap-login :- (s/maybe UUID) + ;; HIPSPEC-0ZXOVYQ + ;; HIPSPEC-8I2UMLY "If LDAP is enabled and a matching user exists return a new Session for them, or `nil` if they couldn't be authenticated." [username password] @@ -171,6 +173,7 @@ :ip-address (throttle/make-throttler :email, :attempts-threshold 50)}) (api/defendpoint POST "/forgot_password" + ;; HIPSPEC-ZGHOEQW "Send a reset email when user has forgotten their password." [:as {:keys [server-name] {:keys [email]} :body, :as request}] {email su/Email} @@ -260,6 +263,7 @@ (def ^:private google-auth-token-info-url "https://www.googleapis.com/oauth2/v3/tokeninfo?id_token=%s") (defn- google-auth-token-info + ;; HIPSPEC-FSCXB53 ([token-info-response] (google-auth-token-info token-info-response (google-auth-client-id))) ([token-info-response client-id] @@ -323,6 +327,7 @@ (mw.session/set-session-cookie request response session-id)))) (api/defendpoint POST "/google_auth" + ;; HIPSPEC-FSCXB53 "Login with Google Auth." [:as {{:keys [token]} :body, :as request}] {token su/NonBlankString} diff --git a/src/metabase/public_settings.clj b/src/metabase/public_settings.clj index 9b99ec1a6f38..6080edf8b081 100644 --- a/src/metabase/public_settings.clj +++ b/src/metabase/public_settings.clj @@ -270,6 +270,7 @@ :setter :none :getter (fn [] (db/exists? 'Database, :is_sample true))) +; HIPSPEC-O0EFWR5 (defsetting password-complexity "Current password complexity requirements" :visibility :public diff --git a/test/metabase/api/alert_test.clj b/test/metabase/api/alert_test.clj index e688ee68167a..2998a24dc4c8 100644 --- a/test/metabase/api/alert_test.clj +++ b/test/metabase/api/alert_test.clj @@ -632,9 +632,10 @@ ;;; +----------------------------------------------------------------------------------------------------------------+ -;;; | PUT /api/alert/:id/unsubscribe | +;;; | PUT /api/alert/:id/unsubscribe ;;; HIPSPEC-GZHQERJ | ;;; +----------------------------------------------------------------------------------------------------------------+ + (defn- alert-unsubscribe-url [alert-or-id] (format "alert/%d/unsubscribe" (u/get-id alert-or-id)))