-
-
Notifications
You must be signed in to change notification settings - Fork 150
[feature] Added support for cross-organization login #1055 #1104
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
base: master
Are you sure you want to change the base?
Changes from all commits
6527636
a6d2b49
55f8244
0d3113b
e114404
6a7cad3
a5b5c04
49a488f
e911526
b0e2467
ce8bd13
9453ad8
ca890cc
ed8fb2f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,5 +47,6 @@ | |
| ] | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "ignorePatterns": ["openwisp-radius/"] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -107,7 +107,8 @@ jobs: | |
|
|
||
| - name: Get openwisp-radius | ||
| run: | | ||
| git clone --depth=1 https://github.com/openwisp/openwisp-radius/ openwisp-radius | ||
| # TODO: Remove branch before merging | ||
| git clone --depth=1 --branch issues/692-different-identity-verification https://github.com/openwisp/openwisp-radius/ openwisp-radius | ||
| cd openwisp-radius | ||
| echo "OpenWISP RADIUS commit: $(git rev-parse HEAD)" | ||
| echo "OW_RADIUS_VERSION=$(git rev-parse HEAD)" >> $GITHUB_ENV | ||
|
|
@@ -131,6 +132,7 @@ jobs: | |
| pip install -U pip setuptools wheel | ||
| pip install -U -e ".[saml]" | ||
| pip install -U -r requirements-test.txt | ||
| pip install --no-deps --no-cache-dir --force-reinstall "https://github.com/openwisp/openwisp-users/tarball/issues/497-export-users" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Verify mutable dependency refs in workflow
rg -n --type=yaml -C2 \
'git clone.*--branch.*openwisp-radius|openwisp-users/tarball/issues/' \
.github/workflows/ci.ymlRepository: openwisp/openwisp-wifi-login-pages Length of output: 724 🏁 Script executed: cat -n .github/workflows/ci.yml | sed -n '105,140p'Repository: openwisp/openwisp-wifi-login-pages Length of output: 1778 🏁 Script executed: # Check the git history/blame for context on when line 135 was added relative to the TODO
git log -p --all -S "issues/497-export-users" -- .github/workflows/ci.yml | head -50Repository: openwisp/openwisp-wifi-login-pages Length of output: 60 Pin Line 135 installs from a mutable branch tarball ( Suggested fix- pip install --no-deps --no-cache-dir --force-reinstall "https://github.com/openwisp/openwisp-users/tarball/issues/497-export-users"
+ OW_USERS_REF=<commit-sha>
+ pip install --no-deps --no-cache-dir --force-reinstall "https://github.com/openwisp/openwisp-users/tarball/${OW_USERS_REF}"🤖 Prompt for AI Agents
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @coderabbitai we will remove this before merging! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
🧠 Learnings used |
||
| pip install -U "Django~=5.2.0" | ||
| ./tests/manage.py migrate | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| import {until} from "selenium-webdriver"; | ||
| import { | ||
| getDriver, | ||
| getElementByCss, | ||
| urls, | ||
| initialData, | ||
| initializeData, | ||
| tearDown, | ||
| getPhoneToken, | ||
| successToastSelector, | ||
| } from "./utils"; | ||
|
|
||
| describe("Selenium tests for cross-organization phone verification", () => { | ||
| let driver; | ||
|
|
||
| beforeAll(async () => { | ||
| await initializeData("crossOrgPhoneVerification"); | ||
| driver = await getDriver(); | ||
| }, 30000); | ||
|
|
||
| afterAll(async () => { | ||
| await tearDown(driver); | ||
| }); | ||
|
|
||
| it("should login to a new organization and complete phone verification", async () => { | ||
| const data = initialData().crossOrgPhoneVerificationUser; | ||
| await driver.get(urls.verificationLogin(data.targetOrganization)); | ||
| const username = await getElementByCss(driver, "input#username"); | ||
| await username.sendKeys(data.phoneNumber); | ||
| const password = await getElementByCss(driver, "input#password"); | ||
| await password.sendKeys(data.password); | ||
| const submitBtn = await getElementByCss(driver, "input[type=submit]"); | ||
| await submitBtn.click(); | ||
| const successToastDiv = await getElementByCss(driver, successToastSelector); | ||
| await driver.wait(until.elementIsVisible(successToastDiv)); | ||
| await driver.wait( | ||
| until.urlContains( | ||
| `/${data.targetOrganization}/mobile-phone-verification`, | ||
| ), | ||
| 5000, | ||
| ); | ||
| const codeInput = await getElementByCss(driver, "input#code"); | ||
| const token = getPhoneToken(data.phoneNumber); | ||
| await codeInput.sendKeys(token); | ||
| const verifyBtn = await getElementByCss(driver, "button[type='submit']"); | ||
| await verifyBtn.click(); | ||
| await driver.wait( | ||
| until.urlContains(`/${data.targetOrganization}/status`), | ||
| 5000, | ||
| ); | ||
| const emailElement = await getElementByCss( | ||
| driver, | ||
| "div > p:nth-child(5) > span", | ||
| ); | ||
| expect(await emailElement.getText()).toEqual(data.email); | ||
| }); | ||
| }); |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: openwisp/openwisp-wifi-login-pages
Length of output: 592
Pin
openwisp-radiusto an immutable commit before merge.At Line 111, cloning a mutable branch head makes CI non-deterministic—upstream force-push or updates can change results without changes in this PR. Use a fixed commit SHA instead.
Suggested change
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@coderabbitai we will remove this before merging!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pandafy, understood! The# TODOcomment itself serves as a good reminder. Just make sure to also remove the pinnedopenwisp-usersforce-reinstall step (Line 128) and revert theopenwisp-radiusbranch dependency back to the default clone once openwisp/openwisp-radius#692 is merged and released.🧠 Learnings used