Skip to content

Commit c5fb37e

Browse files
authored
Merge pull request #34 from softwareone-platform/MPT-10442_delegate_pwd_validation_to_upstream
MPT-10442 delegate password length validation to optscale
2 parents cb2fa5b + c427a46 commit c5fb37e

File tree

3 files changed

+74
-2
lines changed

3 files changed

+74
-2
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Notify Teams on PR
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
jobs:
8+
notify-teams:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
- name: Compute added/removed lines for notification
15+
id: diff
16+
run: |
17+
PR_DATA=$(gh pr view "${{ github.event.pull_request.number }}" --json additions,deletions -q '.')
18+
ADDITIONS=$(echo "$PR_DATA" | jq '.additions')
19+
DELETIONS=$(echo "$PR_DATA" | jq '.deletions')
20+
echo "additions=$ADDITIONS" >> $GITHUB_OUTPUT
21+
echo "deletions=$DELETIONS" >> $GITHUB_OUTPUT
22+
env:
23+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
- name: Notify Microsoft Teams
25+
uses: softwareone-platform/notify-pr-teams-action@v4
26+
with:
27+
webhook_url: ${{ secrets.TEAMS_WEBHOOK_URL }}
28+
bot_image_url: https://raw.githubusercontent.com/softwareone-platform/ffc-finops-operations/main/.github/workflows/assets/turing_team_pr_bot.png
29+
repo: ${{ github.repository }}
30+
pr_url: ${{ github.event.pull_request.html_url }}
31+
pr_title: ${{ github.event.pull_request.title }}
32+
pr_author: ${{ github.event.pull_request.user.login }}
33+
head_ref: ${{ github.event.pull_request.head.ref }}
34+
base_ref: ${{ github.event.pull_request.base.ref }}
35+
commits: ${{ github.event.pull_request.commits }}
36+
changed_files: ${{ github.event.pull_request.changed_files }}
37+
additions: ${{ steps.diff.outputs.additions }}
38+
deletions: ${{ steps.diff.outputs.deletions }}
39+
pr_number: ${{ github.event.pull_request.number }}
40+
pr_status: ${{ github.event.pull_request.state }}
41+
is_merged: ${{ github.event.pull_request.merged }}

.github/workflows/pr-build-merge.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,37 @@ jobs:
3434
- name: 'Run bandit security scan'
3535
run: docker compose run --rm bandit
3636

37+
- name: Compute added/removed lines for notification
38+
if: ${{ github.event_name == 'pull_request' }}
39+
id: diff
40+
run: |
41+
PR_DATA=$(gh pr view "${{ github.event.pull_request.number }}" --json additions,deletions -q '.')
42+
ADDITIONS=$(echo "$PR_DATA" | jq '.additions')
43+
DELETIONS=$(echo "$PR_DATA" | jq '.deletions')
44+
echo "additions=$ADDITIONS" >> $GITHUB_OUTPUT
45+
echo "deletions=$DELETIONS" >> $GITHUB_OUTPUT
46+
env:
47+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
- name: Notify Microsoft Teams
49+
if: ${{ github.event_name == 'pull_request' }}
50+
uses: softwareone-platform/notify-pr-teams-action@v4
51+
with:
52+
webhook_url: ${{ secrets.TEAMS_WEBHOOK_URL }}
53+
bot_image_url: https://raw.githubusercontent.com/softwareone-platform/ffc-finops-api-modifier/main/.github/workflows/assets/turing_team_pr_bot.png
54+
repo: ${{ github.repository }}
55+
pr_url: ${{ github.event.pull_request.html_url }}
56+
pr_title: ${{ github.event.pull_request.title }}
57+
pr_author: ${{ github.event.pull_request.user.login }}
58+
head_ref: ${{ github.event.pull_request.head.ref }}
59+
base_ref: ${{ github.event.pull_request.base.ref }}
60+
commits: ${{ github.event.pull_request.commits }}
61+
changed_files: ${{ github.event.pull_request.changed_files }}
62+
additions: ${{ steps.diff.outputs.additions }}
63+
deletions: ${{ steps.diff.outputs.deletions }}
64+
pr_number: ${{ github.event.pull_request.number }}
65+
pr_status: ${{ github.event.pull_request.state }}
66+
is_merged: ${{ github.event.pull_request.merged }}
67+
3768
- name: SonarQube Scan
3869
uses: sonarsource/sonarqube-scan-action@v4
3970
env:

app/api/users/model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
from __future__ import annotations
22

3-
from pydantic import BaseModel, ConfigDict, EmailStr, constr
3+
from pydantic import BaseModel, ConfigDict, EmailStr
44

55

66
class CreateUserData(BaseModel):
77
email: EmailStr
88
display_name: str
9-
password: constr(min_length=8)
9+
password: str
1010

1111

1212
class CreateUserResponse(BaseModel):

0 commit comments

Comments
 (0)