Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/item_scan.yml
Original file line number Diff line number Diff line change
@@ -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 }}"


1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.rb
*.class
*.iml
*.jar
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 2 additions & 0 deletions frontend/src/metabase/alert/alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/metabase/components/UserAvatar.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* @flow */

// HIPSPEC-9JF7M58
import styled from "styled-components";
import { Flex } from "grid-styled";
import { height } from "styled-system";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/metabase/entities/users/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const DETAILS_FORM_FIELDS: () => FormFieldDefinition[] = () => [
},
];

// HIPSPEC-KDECLSP
const LOCALE_FIELD: FormFieldDefinition = {
name: "locale",
title: t`Language`,
Expand All @@ -42,6 +43,7 @@ const LOCALE_FIELD: FormFieldDefinition = {
].map(([code, name]) => ({ name, value: code })),
};

// HIPSPEC-VB4X2RW
const PASSWORD_FORM_FIELDS: () => FormFieldDefinition[] = () => [
{
name: "password",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/metabase/lib/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class Settings {
ssoEnabled() {
return this.get("google-auth-client-id") != null;
}

// HIPSPEC-8I2UMLY
ldapEnabled() {
return this.get("ldap-configured?");
}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/metabase/plugins/builtin/auth/ldap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => [
Expand Down
1 change: 1 addition & 0 deletions frontend/src/metabase/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export const SlackApi = {
updateSettings: PUT("/api/slack/settings"),
};

// HIPSPEC-8I2UMLY
export const LdapApi = {
updateSettings: PUT("/api/ldap/settings"),
};
Expand Down
1 change: 1 addition & 0 deletions src/metabase/api/alert.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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?)
Expand Down
1 change: 1 addition & 0 deletions src/metabase/api/ldap.clj
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
;; HIPSPEC-8I2UMLY
(ns metabase.api.ldap
"/api/ldap endpoints"
(:require [clojure.set :as set]
Expand Down
5 changes: 5 additions & 0 deletions src/metabase/api/session.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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}
Expand Down
1 change: 1 addition & 0 deletions src/metabase/public_settings.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion test/metabase/api/alert_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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)))

Expand Down