Compare commits

...
363 Commits
Author SHA1 Message Date
Randall Morey 4fa5b924c9 Merge pull request #562 from hashicorp/chore-bump-cli-version
chore:  bump CLI version and update changelog
2021-05-19 13:23:22 -04:00
Randall Morey e86a4fc27d chore: bump CLI version and update changelog 2021-05-19 13:04:40 -04:00
Randall Morey d72b02ad29 Merge pull request #555 from hashicorp/ICU-1335-close-all-sessions-on-exit
feat: Prompt before quitting inprogress session on desktop client quit
2021-05-19 12:52:19 -04:00
Randall Morey 545e7d5a7f fix: import session manager correctly and reconstruct origin URL without extra colons 2021-05-19 09:45:07 -04:00
Randall Morey 4055f3a06e Merge pull request #560 from hashicorp/refactor-session-management
refactor:  change isActive to isRunning and related language to reduc…
2021-05-18 17:34:01 -04:00
Randall Morey 4fed7f3d94 refactor: rename to "running" 2021-05-17 17:23:18 -04:00
Randall Morey ee29f3c599 refactor: change isActive to isRunning and related language to reduce confusion with the API concept of session status "active" 2021-05-17 16:33:34 -04:00
Susmitha Girumala a1b0481db9 Merge branch 'main' into ICU-1335-close-all-sessions-on-exit 2021-05-17 14:52:39 -04:00
Susmitha Girumala 685ddeac7e Merge pull request #549 from hashicorp/ICU-1335-close-session-on-cancel
feat: Close local proxy on session cancellation in Desktop
2021-05-17 08:29:51 -04:00
Susmitha Girumala f2f5a46cdf refactor: Add conditional chaining to session-manager call 2021-05-14 15:08:06 -04:00
Susmitha Girumala 1a0650ff7c fix: Add url validation to origin validation in desktop 2021-05-14 15:00:24 -04:00
Susmitha Girumala 82a0c7c17c refactor: Rename origin service to runtime-settings 2021-05-14 14:29:26 -04:00
Susmitha Girumala 1397df807f fix: Add url validation to origin addr in desktop 2021-05-14 10:40:50 -04:00
Susmitha Girumala cc01bddea3 refactor: Create net-request-promise helper for runtimesettin 2021-05-13 12:50:01 -04:00
Susmitha Girumala 9f32b8cdc3 refactor: Origin runtime settings into origin service desktop 2021-05-13 10:36:28 -04:00
Susmitha Girumala ae8e20b8e1 refactor: Create services folder in desktop/electron-app 2021-05-13 10:23:22 -04:00
Susmitha Girumala aab980a7dc Merge remote-tracking branch 'origin/ICU-1335-close-session-on-cancel' into ICU-1335-close-all-sessions-on-exit 2021-05-12 17:01:29 -04:00
Susmitha Girumala 13146975e2 fix: Add missing cli folder in electron-app 2021-05-12 16:57:27 -04:00
Susmitha Girumala 542b469ad8 chore: Reapply stopping all session in desktop after merge 2021-05-12 15:46:40 -04:00
Susmitha Girumala c2c63294f4 Merge branch 'ICU-1335-close-session-on-cancel' into ICU-1335-close-all-sessions-on-exit 2021-05-12 15:41:47 -04:00
Susmitha Girumala 56936f78b8 chore: Update cancel to stop for ipc sessions call
Additional cleanup: remove unused async calls, separate session and
associated manager models, & attempt encoding origin url as part of
sanitization for cli command
2021-05-12 15:31:28 -04:00
Susmitha Girumala dcc77153bf feat: Do not allow desktop to quit without closing sessions 2021-05-12 14:27:01 -04:00
Susmitha Girumala 4b587d35fa docs: Add feature note to changelog 2021-05-12 12:48:03 -04:00
Susmitha Girumala ce7cdba0bc feat: Prompt for quitting session on desktop quit 2021-05-12 12:45:05 -04:00
Susmitha Girumala 4e13ea56c3 Add bug fix to changelog 2021-05-12 12:35:17 -04:00
Susmitha Girumala 3ef7436f3f chore: Cleanup SessionManager interface 2021-05-12 11:40:50 -04:00
Susmitha Girumala ee748de5c9 chore: Run cancellation tests in electron 2021-05-12 11:10:11 -04:00
Susmitha Girumala 74501a440f refactor: Create structure in desktop/electron-app 2021-05-12 10:27:38 -04:00
Susmitha Girumala 828faf2be4 refactor: Create helpers folder in desktop/electron 2021-05-12 09:53:10 -04:00
Susmitha Girumala dfb9d6e686 Merge remote-tracking branch 'origin/main' into ICU-1335-close-session-on-cancel 2021-05-11 18:09:50 -04:00
Susmitha Girumala 2be18bcf6f chore: Cleanup 2021-05-11 18:09:38 -04:00
Susmitha Girumala 3bef3e4bc5 Merge pull request #553 from hashicorp/chore-desktop-hbs-prettier
upgrade prettier and apply HBS formatting to desktop
2021-05-11 18:01:49 -04:00
Susmitha Girumala 81447e65c8 Merge pull request #552 from hashicorp/chore-admin-hbs-prettier-lint
chore: 🤖 add prettier hbs linting plugin
2021-05-11 18:01:19 -04:00
Susmitha Girumala 2e71beee81 Merge pull request #551 from hashicorp/chore-admin-hbs-prettier
chore: 🤖 upgrade prettier and apply HBS formatting to admin
2021-05-11 17:58:42 -04:00
Susmitha Girumala dfbb54a1ee refactor: Add SessionManager and Session classes to electron 2021-05-11 16:42:30 -04:00
Randall Morey 0d67b512a2 chore: 🤖 add prettier 2.3 and apply hbs formatting and linting 2021-05-11 15:39:59 -04:00
Randall Morey e551ec4008 chore: 🤖 add prettier hbs linting plugin 2021-05-11 15:29:46 -04:00
Randall Morey 49a85f1a7f chore: 🤖 upgrade prettier and apply HBS formatting to admin 2021-05-11 14:13:24 -04:00
Susmitha Girumala 15d3520408 Merge pull request #550 from hashicorp/fix-trim-package-vulnerability
fix: 🐛 Update trim package version resolution
2021-05-11 12:38:11 -04:00
Carlos Alcaide 5d7c0180d5 fix: 🐛 Update trim package version resolution
Update the version we resolve of dependency package trim since older
version has a security vulnerability.
2021-05-11 08:33:44 -07:00
Susmitha Girumala 053e16dca8 Merge branch 'main' into ICU-1335-close-session-on-cancel 2021-05-11 11:13:37 -04:00
Susmitha Girumala 3e2ed2dc27 Merge pull request #548 from hashicorp/fix-flaky-origin-test
fix: 🐛 migrate IPC to service-based window for reliable testing
2021-05-10 11:07:32 -04:00
Susmitha Girumala faaf7352c1 Merge branch 'main' into fix-flaky-origin-test 2021-05-10 10:32:57 -04:00
Susmitha Girumala 58252ee6f5 Merge pull request #547 from hashicorp/refactor-oidc-inline
Enable inline OIDC flow for admin
2021-05-10 10:32:43 -04:00
Randall Morey 85ddd7fc4b chore: remove empty comments 2021-05-08 12:10:41 -04:00
Randall Morey 863e81bc01 fix: 🐛 migrate IPC to service-based window for reliable testing
This resolves a longstanding issue where IPC tests rely on the real
window.postMessage and MessageChannel APIs.  These are evented and
asynchronous, resulting in nondeterministic tests.  This commit updates
tests with synchronous mocked APIs.
2021-05-08 12:08:56 -04:00
Randall Morey 4b212e1ae0 Merge branch 'refactor-oidc-inline' of https://github.com/hashicorp/boundary-ui into refactor-oidc-inline 2021-05-08 07:50:28 -04:00
Randall Morey 343f73bc21 style: set max width for SVG in dialog 2021-05-08 07:50:16 -04:00
Randall Morey cf5f41acbd fix: 🐛 handle null window in case of popup blocker 2021-05-08 07:49:53 -04:00
Susmitha Girumala 2f12cc91f2 feat: Cancelling session should close associated spawned proc 2021-05-07 15:31:32 -04:00
Susmitha Girumala 99125dbb77 feat: Cleanup spawned session after process termination 2021-05-07 15:31:31 -04:00
Randall Morey 3bfae4b33d Merge branch 'main' into refactor-oidc-inline 2021-05-07 15:24:12 -04:00
Randall Morey da6b34b337 feat: 🎸 enable inline OIDC authentication 2021-05-07 14:32:37 -04:00
Randall Morey 9a909c0ec1 chore: 🤖 retry oidc should also restart with boundary
rather than just re-opening the external window
2021-05-07 13:21:18 -04:00
Randall Morey 42c01100ad Merge branch 'main' into refactor-oidc-inline 2021-05-07 13:04:58 -04:00
Carlos Alcaide Corvo fe56acd57f Merge pull request #545 from hashicorp/feat-fieldset-component
feat: 🎸 Add Form fieldset component
2021-05-07 08:34:09 -07:00
Carlos Alcaide e4fb2e7c4d feat: 🎸 Fix ARIA issues and add tests
Fix an ARIA issue where fieldset aria-describedby was pointing the
legend when it should point to description. Also no aria-describedby
will show if description (optional) is not provided.
2021-05-06 15:33:59 -07:00
Carlos Alcaide b1361bcb83 feat: 🎸 Applying PR suggested changes
Apply the changes suggested on the PR. Also modified tests to could test
the rendering of the componet without description field.
2021-05-06 14:55:13 -07:00
Carlos Alcaide 30090d82e3 feat: 🎸 Add Form fieldset component
Add a simple form fieldset component, basic storybook page and tests.

✅ Closes: ICU-1428
2021-05-06 14:55:13 -07:00
Susmitha Girumala fbe8aefcb4 Merge pull request #546 from hashicorp/chore-bump-deps
chore: 🤖 bump deps due to security audit
2021-05-06 16:45:16 -04:00
Randall Morey fa02fd3f89 chore: 🤖 bump deps due to security audit 2021-05-06 15:30:02 -04:00
Randall Morey f021719d8b refactor: open and close oidc windows via window manager 2021-05-06 15:19:12 -04:00
Randall Morey be9ee8f672 Merge pull request #544 from hashicorp/chore-dependabot
chore: 🤖 bump dep version for dependabot
2021-05-05 17:45:23 -04:00
Randall Morey 48ca4c5ac0 chore: 🤖 bump dep version for dependabot 2021-05-05 15:06:32 -04:00
Randall Morey ac7db55be2 Merge pull request #542 from hashicorp/refactor-browser-services
chore: 🤖 replace admin window usage with ember browser services
2021-05-05 14:51:40 -04:00
Randall Morey dea79d785b feat: 🎸 add WindowManager service for simple open/close 2021-05-05 14:34:26 -04:00
Randall Morey f597901140 Merge branch 'main' into refactor-browser-services 2021-05-05 13:51:01 -04:00
Randall Morey 0c1b5bf879 Merge pull request #543 from hashicorp/fix-vulnerability-merge-package
fix: 🐛 Fix merge package vulnerability
2021-05-05 13:50:36 -04:00
Carlos Alcaide bab68f4507 fix: 🐛 Fix merge package vulnerability
Merge package has a security vulnerability that is fixed in a newer
version. We do not resolve merge directly, but as a dependecy of a
dependecy, so we especify a version range via selective dependecy
resolution.
2021-05-05 10:23:11 -07:00
Carlos Alcaide Corvo c6e4a24dab Merge pull request #541 from hashicorp/docs-connect-ui-to-boundary-local
docs: ✏️ Connect Boundary UI to Boundary local instance
2021-05-04 07:44:48 -07:00
Carlos Alcaide 0bcb91ede0 docs: ✏️ Update docs for PR
Update documentation with suggestions from PR
2021-05-03 14:13:52 -07:00
Carlos Alcaide fbeb764c76 Merge branch 'docs-connect-ui-to-boundary-local' of github.com:hashicorp/boundary-ui into docs-connect-ui-to-boundary-local 2021-05-03 14:04:18 -07:00
Carlos Alcaide 67959d7a58 docs: ✏️ Update docs from PR
Update documentation with comments from team members on my initial PR.
2021-05-03 14:03:43 -07:00
Susmitha Girumala c4bb5173d2 Merge branch 'main' into docs-connect-ui-to-boundary-local 2021-05-03 15:44:24 -04:00
Carlos Alcaide ea011592a7 docs: ✏️ Connect Boundary UI to Boundary local instance
Add documentation on how to connect Boundary UI, admin and desktop
version, to a Boundary local instance.
2021-05-03 12:42:55 -07:00
Susmitha Girumala e761e0e4af Merge pull request #540 from hashicorp/docs-m1
docs:  add troubleshooting note for M1 users
2021-05-03 15:39:57 -04:00
Randall Morey fa36f9008b docs: add troubleshooting note for M1 users 2021-04-30 17:16:21 -04:00
Randall Morey 15d360abc5 Merge pull request #539 from hashicorp/chore-update-node-engines
chore: 🤖 Update node version engines
2021-04-30 17:10:30 -04:00
Randall Morey 9914954d08 docs: ✏️ add engines to top-level package.json 2021-04-30 16:58:54 -04:00
Carlos Alcaide ec184ff4f1 chore: 🤖 Update UI's to could use node v15
Update UI's engines in package.json to could use node v15. The change is
motivated for apple M1 chip. If you have an apple M1 chip you need to
use node v15 to avoid errors while building the UI.
2021-04-29 14:39:48 -07:00
Randall Morey bb2d0420d9 chore: 🤖 replace admin window usage with ember browser services 2021-04-28 17:55:30 -04:00
Carlos Alcaide e3cabe3102 chore: 🤖 Update node version engines for addons
Update the versions of node addons can use to be aligned with the node
versions defined in our UI's.
2021-04-28 14:26:46 -07:00
Carlos Alcaide 7065f462cd chore: 🤖 Update node version engines
Update the node versions our UI's can use. These versions are specified
on the engines key in the package.json of each UI (admin and desktop).
Our UI's can run from node v10 to v14, we can not run on v15 because
ember-cli does not support it yet.
2021-04-28 11:35:52 -07:00
Susmitha Girumala 6e4ab7d881 Merge pull request #537 from hashicorp/bump-cli-0-2-0
Bump cli to 0.2.0
2021-04-15 09:27:34 -04:00
Susmitha Girumala 859a3fdd83 chore: Bump cli to 0.2.0 2021-04-15 09:13:54 -04:00
Susmitha Girumala b1568aa30f chore: Set current version to 1.0.0 for release 2021-04-15 09:08:21 -04:00
Randall Morey a46b44b13f Merge pull request #536 from hashicorp/bump-changelog
docs: Bump changelog for 1.0.0 - desktop
2021-04-14 19:52:12 -04:00
Susmitha Girumala 59dee87141 Merge branch 'main' into bump-changelog 2021-04-14 17:03:51 -04:00
Susmitha Girumala f1a20ea33d docs: Bump changelog for 1.0.0 2021-04-14 16:59:47 -04:00
Susmitha Girumala 4a5e72d77b Merge pull request #533 from hashicorp/fix-authenticate-read
fix: 🐛 do not load singular auth methods in auth form
2021-04-14 16:53:11 -04:00
Susmitha Girumala 87a6d839e7 Merge pull request #535 from hashicorp/docs-changelog
docs: add OIDC to changelog
2021-04-14 16:43:29 -04:00
Susmitha Girumala 1b449bdea4 Merge pull request #534 from hashicorp/chore-more-error-info
feat: 🎸 show copyable error details in error page
2021-04-14 16:42:19 -04:00
Susmitha Girumala 1ba0c873e9 Merge branch 'main' into fix-authenticate-read 2021-04-14 16:31:49 -04:00
Susmitha Girumala f8e7ec7f5f Merge pull request #532 from hashicorp/check-for-zip-archive-before-update
fix: Check for update archive before prompting download
2021-04-14 16:31:39 -04:00
Randall Morey 4d4affe6d7 docs: add OIDC to changelog 2021-04-14 16:22:25 -04:00
Randall Morey b13befaff2 chore: teak capitalization 2021-04-14 16:16:22 -04:00
Randall Morey 3836656042 feat: 🎸 show copyable error details in error page 2021-04-14 16:11:13 -04:00
Susmitha Girumala 55e3284e3f Merge branch 'main' into fix-authenticate-read 2021-04-14 16:08:27 -04:00
Susmitha Girumala 27a416001b Merge remote-tracking branch 'origin/main' into check-for-zip-archive-before-update 2021-04-14 15:33:09 -04:00
Susmitha Girumala 43a41d6818 Merge pull request #531 from hashicorp/chore-enable-primary-auth-method
chore: 🤖 enable primary auth method feature
2021-04-14 15:32:59 -04:00
Susmitha Girumala b17088803f refactor: Remove ability to hide dialog using suppressPrompt 2021-04-14 15:31:14 -04:00
Susmitha Girumala 5eb9d01b23 Merge branch 'main' into chore-enable-primary-auth-method 2021-04-14 15:15:23 -04:00
Randall Morey 288a38f6ea fix: 🐛 do not load singular auth methods in auth form 2021-04-14 15:13:39 -04:00
Randall Morey e7724ab8a5 fix: 🐛 is_primary should default to false 2021-04-14 14:36:51 -04:00
Susmitha Girumala e7c7d2b280 fix: Check for update archive before prompting download 2021-04-14 13:44:26 -04:00
Randall Morey 80abe240b4 fix: unset mirage flag 2021-04-14 13:27:31 -04:00
Susmitha Girumala 6960aaeffc Merge pull request #530 from hashicorp/fix-error-object-in-desktop-connect
fix: Display api errors in desktop connect
2021-04-14 11:39:40 -04:00
Randall Morey deb8871060 fix: 🐛 API sends is_primary, not primary 2021-04-14 11:28:07 -04:00
Susmitha Girumala ba671b4ab3 Merge branch 'main' into fix-error-object-in-desktop-connect 2021-04-14 11:19:27 -04:00
Susmitha Girumala bd3a4935a4 Merge pull request #529 from hashicorp/fix-typos-in-notifications
fix: Fix misspelling in success notifications
2021-04-14 11:19:13 -04:00
Susmitha Girumala 13ce61218c Merge branch 'main' into fix-typos-in-notifications 2021-04-14 11:05:08 -04:00
Susmitha Girumala fa2e1021c5 Merge pull request #528 from hashicorp/chore-add-feature-flags
chore: 🤖 add disabled feature flags for future work
2021-04-14 11:04:56 -04:00
Randall Morey c213ee18b2 chore: 🤖 enable primary auth method feature 2021-04-14 10:16:34 -04:00
Randall Morey 43c667729f Merge branch 'main' into fix-typos-in-notifications 2021-04-14 10:07:03 -04:00
Susmitha Girumala 26e6cc8a9b fix: Display api errors in desktop connect 2021-04-14 10:03:14 -04:00
Susmitha Girumala 5d57c8dd25 Merge branch 'main' into chore-add-feature-flags 2021-04-14 10:02:33 -04:00
Susmitha Girumala f31a93085a Merge pull request #527 from hashicorp/fix-styles
Fix styles
2021-04-14 10:02:16 -04:00
Susmitha Girumala 1927ef7832 fix: Fix misspelling in success notifications 2021-04-14 09:41:30 -04:00
Randall Morey fd53f7b282 chore: 🤖 add disabled feature flags for future work 2021-04-14 09:40:22 -04:00
Susmitha Girumala eaaeed6d1b Merge branch 'main' into fix-styles 2021-04-14 09:37:35 -04:00
Susmitha Girumala 8f8566548a Merge pull request #526 from hashicorp/fix-hiding-update-dialog
fix: Undefined type issue when not suppressing update dialog
2021-04-14 09:37:23 -04:00
Randall Morey 40e12366e6 fix: use SVG attributes instead of inline styles 2021-04-14 09:12:14 -04:00
Randall Morey 39ea49ccdf Merge branch 'main' into fix-hiding-update-dialog 2021-04-14 08:11:19 -04:00
Randall Morey a69dfa251a Merge pull request #525 from hashicorp/trim-origin-url
fix: Trim origin url in desktop
2021-04-14 08:11:09 -04:00
Susmitha Girumala 906a336acb fix: Undefined type issue when not suppressing update dialog 2021-04-13 18:11:07 -04:00
Randall Morey 9c9988a305 style: cover dialog should have a high z-index and admin OIDC auth button should be block style 2021-04-13 17:25:02 -04:00
Susmitha Girumala 1a901b15d2 fix: Trim first to avoid leaving trailing slashes in origin 2021-04-13 16:57:07 -04:00
Susmitha Girumala e894dbc4e8 fix: Trim origin url in desktop 2021-04-13 16:57:07 -04:00
Susmitha Girumala 18e95435f5 Merge pull request #522 from hashicorp/desktop-update-feature
feat: 🎸 Update desktop through menu option
2021-04-13 16:43:17 -04:00
Susmitha Girumala e2154f9698 Merge branch 'main' into desktop-update-feature 2021-04-13 13:18:52 -04:00
Susmitha Girumala d27ddb1eee Merge pull request #429 from hashicorp/feature-oidc-authenticate
Feature oidc authenticate
2021-04-13 11:42:06 -04:00
Randall Morey 8d3aea2e23 chore: allow insecure localhost external links to open 2021-04-13 11:20:29 -04:00
Randall Morey 4d47b3cf51 Merge branch 'main' into feature-oidc-authenticate 2021-04-13 10:48:29 -04:00
Susmitha Girumala b741d3af16 Merge pull request #523 from hashicorp/fix-copyable-project-id
fix: Show project id to copy in targets list in desktop
2021-04-13 10:40:07 -04:00
Randall Morey 92cf57a542 Merge branch 'main' into fix-copyable-project-id 2021-04-13 10:19:30 -04:00
Randall Morey aa6d369514 Merge pull request #524 from hashicorp/fix-faker-depreciation-warnings
chore: Bump faker and yargs-parser to fix depreciation warns
2021-04-13 10:19:22 -04:00
Randall Morey 1ed685d81f chore: enable OIDC feature flags 2021-04-12 18:12:23 -04:00
Randall Morey 586a4dbe23 feat: 🎸 roll out OIDC to desktop 2021-04-12 18:10:08 -04:00
Susmitha Girumala f858da88f2 chore: Bump faker and yargs-parser to fix depreciation warns 2021-04-12 17:35:57 -04:00
Randall Morey 5f342a0ee8 refactor: 💡 "retry" is a link instead of an action button 2021-04-12 17:10:55 -04:00
Randall Morey 3468acce39 chore: 🤖 OIDC tokens must be added to request auth headers 2021-04-12 16:54:13 -04:00
Susmitha Girumala b0a93e2e2d feat: Check for desktop update on launch 2021-04-12 16:26:46 -04:00
Randall Morey c2b66b74eb feat: 🎸 add oidc-crud feature flag to disable admin list links 2021-04-12 15:31:42 -04:00
Randall Morey 32ec1f0f70 chore: oidc should use 202 2021-04-12 15:16:52 -04:00
Susmitha Girumala e539a86600 fix: Show project id to copy in targets list in desktop 2021-04-12 15:13:10 -04:00
Susmitha Girumala efcdd0701e chore: Use forge config for current version of desktop 2021-04-12 14:52:58 -04:00
Susmitha Girumala 9ab9800f7e docs: Add app updater dev env vars to readme 2021-04-12 14:21:15 -04:00
Susmitha Girumala 4336fde21b fix: Use semver to compare desktop versions for update 2021-04-12 14:10:34 -04:00
Randall Morey 4cb7985ac1 chore: 🤖 token pending status is now 202 2021-04-12 13:47:58 -04:00
Susmitha Girumala 04726a61da docs: Add desktop update feature to changelog 2021-04-12 10:56:12 -04:00
Susmitha Girumala 53270519cb feat: 🎸 Update desktop through menu option 2021-04-12 10:42:34 -04:00
Randall Morey 5105d80a9d fix: 🐛 fix request attributes for OIDC 2021-04-10 12:34:13 -04:00
Randall Morey 53423739d3 chore: 🤖 hide auth form if OIDC and OIDC is disabled 2021-04-09 15:41:32 -04:00
Randall Morey f782d90a7e feat: 🎸 OIDC feature flag (disabled in production) 2021-04-09 14:55:58 -04:00
Randall Morey 721d09899a feat: 🎸 add pending modal with retry and cancel 2021-04-09 14:32:35 -04:00
Randall Morey d1303c7bca Merge branch 'main' into feature-oidc-authenticate 2021-04-09 13:27:38 -04:00
Susmitha Girumala 31682ffd85 Merge pull request #521 from hashicorp/feature-dialog-cover
feat: 🎸 add dialog cover component
2021-04-09 12:24:33 -04:00
Randall Morey b5a791d618 Merge branch 'main' into feature-dialog-cover 2021-04-09 11:45:32 -04:00
Susmitha Girumala e110f33e40 Merge pull request #519 from hashicorp/fix-origin-trailing-slash
fix: 🐛 silently drop trailing slashes from origin input - ICU-1293
2021-04-09 11:43:59 -04:00
Randall Morey 68bf02ee25 chore: 🤖 merge from main 2021-04-09 11:32:20 -04:00
Susmitha Girumala 063d643d76 Merge branch 'main' into fix-origin-trailing-slash 2021-04-09 11:19:47 -04:00
Susmitha Girumala b6818871fc Merge pull request #518 from hashicorp/style-auth-form
Style auth form
2021-04-09 11:19:34 -04:00
Randall Morey 1effa79c93 feat: 🎸 add dialog cover component 2021-04-09 11:07:23 -04:00
Randall Morey 6fd075f7e8 doc: update changelog 2021-04-08 13:58:34 -04:00
Randall Morey 0d8508cd4e fix: 🐛 silently drop trailing slashes from origin input 2021-04-08 13:45:19 -04:00
Randall Morey f3bd8d0b6f test: add missing frame tests 2021-04-08 11:26:29 -04:00
Susmitha Girumala 8889e86cec chore: Add polyfill plugin to storybook config 2021-04-07 14:33:38 -04:00
Randall Morey 6500d56273 style: 💄 add frame component and update admin auth form 2021-04-07 12:53:09 -04:00
99 80cffeb48b Merge pull request #517 from hashicorp/nat/release-test-trigger
Add workflow to trigger test release manually
2021-04-06 08:28:07 -07:00
Randall Morey 263c8c01e9 Merge branch 'main' into feature-oidc-authenticate 2021-04-06 10:37:39 -04:00
Susmitha Girumala 74531f5d85 Merge branch 'main' into nat/release-test-trigger 2021-04-05 09:38:10 -04:00
Susmitha Girumala e0eed2b4ea Merge pull request #516 from hashicorp/feature-oidc-static-callbacks
Add static auth callback pages to admin UI for notifying success or error.
2021-04-02 20:46:10 -04:00
99 c9df20184a Message update 2021-04-02 16:13:24 -07:00
99 afa1deef94 fix messaging 2021-04-02 16:06:31 -07:00
99 5d04dca21e Add workflow to trigger test release 2021-04-02 16:06:21 -07:00
Randall Morey 746f45b6da chore: remove "provider" from auth strings 2021-04-02 18:56:16 -04:00
Randall Morey a62d36af92 feat: 🎸 add auth callback pages 2021-04-02 16:06:38 -04:00
Randall Morey a41572302a Merge pull request #515 from hashicorp/chore-dependabot-alerts
chore: 🤖 add xmldom resolution
2021-04-02 15:33:56 -04:00
Randall Morey 2138aa8b01 chore: 🤖 add xmldom resolution 2021-04-02 15:19:27 -04:00
Randall Morey 4ea53c9cc7 Merge pull request #511 from hashicorp/bump-ember-electron
Bump ember-electron from 3.0.0-beta to 3.0.0
2021-04-02 12:52:13 -04:00
Randall Morey c4e5a4c121 chore: 🤖 merge from main 2021-04-02 12:29:04 -04:00
Randall Morey e5544415b0 Merge pull request #514 from hashicorp/chore-dependabot-alerts
chore: 🤖 yarn install to update lock file
2021-04-02 12:19:24 -04:00
Randall Morey ce84d2405c Merge branch 'main' into bump-ember-electron 2021-04-02 12:00:23 -04:00
Susmitha Girumala b07c90ee53 Merge branch 'main' into chore-dependabot-alerts 2021-04-02 11:59:25 -04:00
Susmitha Girumala 27a28c6db2 Merge pull request #513 from hashicorp/fix-flaky-origin-test
Fix flaky origin test
2021-04-02 11:58:56 -04:00
Randall Morey 82eed3c5fe chore: 🤖 yarn install to update lock file 2021-04-02 11:49:49 -04:00
Randall Morey 3d13d8f412 refactor: 💡 auth payloads now have "attributes" field 2021-04-01 17:41:30 -04:00
Randall Morey 6927008041 refactor: 💡 use command instead of action for auth endpoints 2021-04-01 16:16:46 -04:00
Randall Morey c978958df2 chore: 🤖 merge from main 2021-04-01 15:24:49 -04:00
Randall Morey e8b2e1aa6f Merge branch 'main' into fix-flaky-origin-test 2021-04-01 13:33:02 -04:00
Randall Morey 43528c64c2 test: 💍 build out autoOrigin tests 2021-04-01 13:04:28 -04:00
Randall Morey d7f090f348 test: 💍 dedupe window.location.origin 2021-04-01 10:26:59 -04:00
Susmitha Girumala 93a9efbd1b Merge branch 'main' into bump-ember-electron 2021-04-01 09:29:29 -04:00
Susmitha Girumala a50a0735bb Merge pull request #512 from hashicorp/fix-flaky-origin-test
test: Fix flaky origin test in desktop
2021-04-01 09:29:16 -04:00
Randall Morey 838567c2d2 refactor: 💡 clean up origin error test 2021-03-31 18:00:42 -04:00
Susmitha Girumala 95e6144e44 test: Fix flaky origin test in desktop 2021-03-31 15:02:17 -04:00
Susmitha Girumala 58c9df272f chore: Bump dev electron to latest 12.0.2 2021-03-31 09:50:36 -04:00
Susmitha Girumala 3696e45275 chore: Bump ember-electron to v3.0.0 2021-03-31 09:46:42 -04:00
Randall Morey 73503f98dc Merge pull request #506 from hashicorp/feature-primary-auth-method
Feature primary auth method
2021-03-30 14:14:02 -04:00
Randall Morey 15f6c408d4 fix: typo 2021-03-30 13:21:33 -04:00
Randall Morey 0ccc6e7f78 chore: enable feature in development 2021-03-30 13:21:14 -04:00
Randall Morey 69a10f891a chore: remove empty attribute 2021-03-30 13:12:18 -04:00
Randall Morey 18d5b60c6d chore: remove primary auth method mention for now 2021-03-30 11:27:56 -04:00
Randall Morey f279ac44ca chore: 🤖 cast to boolean explicitly 2021-03-30 10:34:15 -04:00
Randall Morey 29f21e0dfe chore: change to "manage" 2021-03-30 09:10:34 -04:00
Randall Morey 9e588212a4 Merge branch 'feature-primary-auth-method' of https://github.com/hashicorp/boundary-ui into feature-primary-auth-method 2021-03-30 09:04:48 -04:00
Randall Morey 3361aa1800 feat: 🎸 add make/remove primary to auth method list 2021-03-29 19:24:21 -04:00
Randall Morey 5c3b44b2f6 Merge branch 'main' into feature-primary-auth-method 2021-03-29 14:40:24 -04:00
Susmitha Girumala 59d345a912 Merge pull request #505 from hashicorp/zoom-in-shortcut
Specify zoom-in shortcut
2021-03-29 10:49:13 -04:00
Randall Morey 2adfdf6ef6 chore: 🤖 disable primary auth method feature for now 2021-03-26 17:51:33 -04:00
Randall Morey 8aa9a51c88 test: 💍 add primary auth method acceptance tests 2021-03-26 14:55:19 -04:00
Randall Morey 60b7d0134a feat: 🎸 add set/remove primary actions 2021-03-26 12:47:49 -04:00
Randall Morey ae26d588a9 refactor: 💡 primary auth method should be detected on scope
rather than the synthetic `primary` field on auth method
2021-03-26 11:33:43 -04:00
Randall Morey abc1827280 feat: 🎸 add "no primary auth method" warning to index 2021-03-26 09:41:07 -04:00
Susmitha Girumala 682bb14037 docs: Add pr link to changelog 2021-03-25 16:38:32 -04:00
Susmitha Girumala 28ec1008a0 Revert "test: Remove mock in failing origin test in desktop"
This reverts commit 83ab375829.
2021-03-25 16:36:02 -04:00
Susmitha Girumala 83ab375829 test: Remove mock in failing origin test in desktop 2021-03-25 16:19:59 -04:00
Randall Morey e960c34542 feat: 🎸 hide primary auth method behind feature flag 2021-03-25 16:15:32 -04:00
Susmitha Girumala 4d2cb86a62 fix: Trigger zoomin using keyboard shortcut 2021-03-25 16:01:44 -04:00
Randall Morey 22131864f8 feat: 🎸 add primary badge to auth methods UI (listing/form) 2021-03-25 12:48:38 -04:00
Randall Morey ac8a6054b0 feat: 🎸 add API and mock support for primary auth methods 2021-03-24 18:36:34 -04:00
Susmitha Girumala 22d578620d Merge pull request #503 from hashicorp/tests-coverage-desktop
Build all desktop tests in Github action
2021-03-24 10:15:03 -04:00
Susmitha Girumala 82506d11c8 test: Disable random session status updated in testruns 2021-03-23 14:47:07 -04:00
Susmitha Girumala 84818a54f5 chore: Update yarn.lock 2021-03-22 20:37:10 -04:00
Susmitha Girumala a0b2c6883a Merge remote-tracking branch 'origin/main' into tests-coverage-desktop 2021-03-22 20:36:00 -04:00
Susmitha Girumala 180b74cc98 test: 💍 Add scopes test in desktop 2021-03-22 20:32:11 -04:00
Susmitha Girumala 12f2042f87 test: Add targets/sessions test in desktop 2021-03-22 20:25:29 -04:00
Susmitha Girumala f096eaf7d7 test: 💍 Add targets/hosts test
Remove duplicates from origin test
2021-03-22 20:12:25 -04:00
Susmitha Girumala e2ff75f435 Merge pull request #504 from hashicorp/ci-workflow
ci: limit workflow to PRs and specify conservative timeouts
2021-03-22 15:16:13 -04:00
Randall Morey 96ef767e65 test: 💍 add start auth oidc test 2021-03-19 17:03:03 -04:00
Susmitha Girumala f387416d6d test: 💍 Update projects/targets test in desktop 2021-03-19 15:46:34 -04:00
Susmitha Girumala 933ade8a16 test: 💍 Update projects/sessions test in desktop 2021-03-19 14:49:06 -04:00
Susmitha Girumala bf4d43cee2 test: Update projects tests in desktop 2021-03-19 13:16:52 -04:00
Susmitha Girumala 6b3b6c4d58 test: 💍 Update origin test in desktop 2021-03-19 12:58:59 -04:00
Susmitha Girumala 4630e130d4 test: 💍 Update authentication test in desktop 2021-03-19 12:40:12 -04:00
Susmitha Girumala 42ace44716 test: 💍 Add ember-a11y-testing package to desktop 2021-03-19 12:33:36 -04:00
Randall Morey 888b106780 ci: limit workflow to PRs and specify conservative timeouts 2021-03-19 12:10:03 -04:00
Susmitha Girumala 6bd994c86b tests: Update unit tests in desktop 2021-03-19 12:09:06 -04:00
Susmitha Girumala 6ce09162d7 test: Update integration tests in desktop 2021-03-19 11:54:28 -04:00
Jeff Malnick f487c4f0d9 Merge pull request #501 from hashicorp/pronoun-expectations
docs: add contributing guide with pronoun expectations
2021-03-18 16:44:57 -07:00
Jeff Malnick 2d0afd7b9c docs: add contributing guide with pronoun expectations 2021-03-18 08:56:51 -07:00
Randall Morey f406fc3861 chore: 🤖 oidc auth methods are not yet editable in admin ui 2021-03-16 15:41:13 -04:00
Randall Morey 760710ae23 feat: 🎸 add polling error notification and handling 2021-03-16 14:02:34 -04:00
Randall Morey 0219b5c99a fix: move electronegativity comments back to same line 2021-03-15 17:14:23 -04:00
Randall Morey 6056b50939 chore: manual merge from main 2021-03-15 17:08:47 -04:00
Randall Morey 9e57f838d5 chore: 🤖 remove cookies flag from oidc start auth 2021-03-15 17:08:25 -04:00
Randall Morey 896671ceb1 Merge branch 'main' into feature-oidc-authenticate 2021-03-15 16:19:18 -04:00
Randall Morey ca9485053e docs: update doc comments 2021-03-15 16:18:48 -04:00
Randall Morey 7e6c46de2b docs: update doc comments 2021-03-15 16:18:22 -04:00
Susmitha Girumala c68c1ba0fb Merge pull request #500 from hashicorp/docs-cli-version
docs: add CLI versions to changelog
2021-03-15 15:19:59 -04:00
Susmitha Girumala 5f83751db2 Merge branch 'main' into docs-cli-version 2021-03-15 14:44:29 -04:00
Susmitha Girumala 8179ab7dec Merge pull request #499 from hashicorp/chore-dependabot
chore: 🤖 bump deps for dependabot
2021-03-15 14:44:04 -04:00
Susmitha Girumala d93d48197f Merge branch 'main' into chore-dependabot 2021-03-15 14:27:51 -04:00
Susmitha Girumala d010d25934 Merge pull request #498 from hashicorp/chore-remove-getwithdefault
chore: 🤖 remove getwithdefault
2021-03-15 13:23:59 -04:00
Susmitha Girumala 3bb9d66377 Merge branch 'main' into chore-remove-getwithdefault 2021-03-15 11:39:13 -04:00
Susmitha Girumala 42fe8f4eca Merge pull request #494 from hashicorp/chore-electronegativity-audit
chore: 🤖 add electronegativity inline disable flags
2021-03-15 11:38:36 -04:00
Susmitha Girumala 45bf901d9e Merge branch 'main' into chore-electronegativity-audit 2021-03-15 11:27:38 -04:00
Randall Morey a35aacdf5e docs: add CLI versions to changelog 2021-03-15 10:07:26 -04:00
Randall Morey feddb2efad chore: 🤖 bump deps for dependabot 2021-03-12 16:44:15 -05:00
Randall Morey 47c664eda9 Merge branch 'chore-remove-getwithdefault' into feature-oidc-authenticate 2021-03-12 16:07:55 -05:00
Randall Morey 9d847348a0 chore: 🤖 remove getwithdefault 2021-03-12 16:06:08 -05:00
Randall Morey 9fc2b7a409 manual merge from main 2021-03-12 12:34:12 -05:00
Susmitha Girumala 02642bc5e4 Merge pull request #497 from hashicorp/rename-release-commit-var
chore: Rename COMMIT var to RELEASE_COMMIT to match CircleCi
2021-03-10 15:06:10 -05:00
Susmitha Girumala 8f8e257523 chore: Rename COMMIT var to RELEASE_COMMIT to match CircleCi 2021-03-10 14:56:00 -05:00
Susmitha Girumala 86916bb842 Merge pull request #496 from hashicorp/chore-output-env-vars
chore: add env var output during desktop build of RELEASE_VERSION and…
2021-03-10 13:40:09 -05:00
Randall Morey a81de6a996 chore: add env var output during desktop build of RELEASE_VERSION and COMMIT 2021-03-10 13:30:34 -05:00
Susmitha Girumala e3e3009afc Merge pull request #495 from hashicorp/bump-cli-version
chore: Bump cli verstion to 0.1.8
2021-03-10 12:16:24 -05:00
Susmitha Girumala 29ff79942b chore: Bump cli verstion to 0.1.8 2021-03-10 11:53:14 -05:00
Randall Morey e50db68abe chore: 🤖 add electronegativity inline disable flags
these occurrences have been manually checked and approved
2021-03-08 17:57:04 -05:00
Randall Morey 2f5ea0fcba Merge pull request #492 from hashicorp/remove-unused-apple-entitlement
fix: Remove unnecessary debugger apple entitlement
2021-03-08 16:32:51 -05:00
Susmitha Girumala dc27ac2d52 chore: Update yarn audit ignore list 2021-03-08 14:22:12 -05:00
Susmitha Girumala 50d568605b fix: Rename desktop release version env var 2021-03-08 11:59:49 -05:00
Susmitha Girumala b79f8b6552 fix: Remove unnecessary debugger apple entitlement 2021-03-08 11:05:26 -05:00
Susmitha Girumala 99754e47e0 Merge pull request #491 from hashicorp/chore-ember-upgrade
Chore ember upgrade
2021-03-08 10:51:55 -05:00
Randall Morey ea1c32ad8b chore: 🤖 manual merge from main 2021-03-06 10:34:44 -05:00
Randall Morey ba34b6c4f9 refactor: 💡 upgrade ui/desktop to Ember 3.24 2021-03-05 17:49:47 -05:00
Randall Morey 60675a12a6 refactor: 💡 upgrade ui/admin to Ember 3.24 2021-03-05 17:27:00 -05:00
Randall Morey a17ca4a9fb refactor: 💡 upgrade addons/rose to Ember 3.24 2021-03-05 16:21:08 -05:00
Randall Morey 17d2df9f52 refactor: 💡 upgrade addons/core to Ember 3.24 2021-03-05 14:22:06 -05:00
Randall Morey 6541fbade8 refactor: 💡 upgrade addons/auth to Ember 3.24 2021-03-05 13:39:44 -05:00
Susmitha Girumala 11d054152f Merge pull request #487 from hashicorp/chore-poll-targets
Chore poll targets - ICU-1103
2021-03-05 10:48:57 -05:00
Susmitha Girumala 3cc70256de Merge branch 'main' into chore-poll-targets 2021-03-05 10:33:04 -05:00
Susmitha Girumala 24bbaeb6ad Merge pull request #483 from hashicorp/chore-support-cli-json-updates
chore: 🤖 support api_errors and drop errors format flag
2021-03-05 10:32:48 -05:00
Susmitha Girumala 4659b7beed Merge branch 'main' into chore-support-cli-json-updates 2021-03-05 10:14:27 -05:00
Susmitha Girumala 49795c81c1 Merge pull request #486 from hashicorp/feature-desktop-filtering
Feature desktop filtering - ICU-1169 ICU-1071
2021-03-04 16:48:41 -05:00
Randall Morey fbf39b3bba refactor: 💡 upgrade addons/api to Ember 3.24 2021-03-04 15:47:38 -05:00
Susmitha Girumala bcbd81a31c Merge branch 'main' into feature-desktop-filtering 2021-03-04 12:32:20 -05:00
99 0fae093112 Merge pull request #490 from hashicorp/tag_fix
Fix a tag parameter for the release pipeline
2021-03-04 09:30:35 -08:00
99andSam Salisbury 6ed036a35e Update .github/workflows/ui-release-trigger.yml
Co-authored-by: Sam Salisbury <samsalisbury@gmail.com>
2021-03-01 14:38:10 -08:00
99 c8a843e843 Fix a tag parameter for the release pipeline 2021-02-27 11:01:26 -08:00
99 050c2577d0 Merge pull request #489 from hashicorp/tag_debug2
Fixing the TAG issue
2021-02-27 10:55:10 -08:00
Randall Morey ec23e3706b Merge branch 'main' into feature-oidc-authenticate 2021-02-27 08:20:59 -05:00
Randall Morey dbb7f65930 Merge branch 'feature-desktop-filtering' into chore-poll-targets 2021-02-27 08:20:16 -05:00
Randall Morey f2af91c780 Merge branch 'main' into feature-desktop-filtering 2021-02-27 08:19:23 -05:00
Randall Morey 31c985d8d1 Merge branch 'main' into chore-support-cli-json-updates 2021-02-27 08:19:15 -05:00
99 07d5d7dc46 Merge branch 'main' into tag_debug2 2021-02-26 17:45:23 -08:00
99 71148c3f77 debug tag 2021-02-26 17:43:20 -08:00
99 06c6b18f33 debug tag 2021-02-26 17:30:33 -08:00
Randall Morey e1e92cc36b Merge branch 'main' into chore-poll-targets 2021-02-26 19:28:09 -05:00
Randall Morey 61562aea0a docs: add changelog entry 2021-02-26 19:27:47 -05:00
99 560b0c8578 Merge pull request #488 from hashicorp/tag_debug
Tag debug
2021-02-26 14:48:28 -08:00
99 841709cd16 debug tag 2021-02-26 14:15:33 -08:00
Randall Morey 837d75f733 chore: 🤖 poll for targets too, so desktop views are "live" 2021-02-26 17:07:29 -05:00
99 342444e3d0 debug tag 2021-02-26 14:04:29 -08:00
Randall Morey 13a8b531a7 feat: 🎸 filter top-level sessions by current user ID 2021-02-26 16:37:12 -05:00
Randall Morey 03963579a1 feat: 🎸 filter desktop targets by authorize-session action 2021-02-26 16:17:30 -05:00
Susmitha Girumala 998c227341 Merge pull request #485 from hashicorp/chore-auth-deprecation-fix
chore: 🤖 rip out deprecated route mixin
2021-02-26 14:13:34 -05:00
Randall Morey 10fe08c28d chore: 🤖 rip out deprecated route mixin 2021-02-26 12:04:12 -05:00
Randall Morey e9c297b1cf chore: 🤖 update token endpoint to match API 2021-02-26 10:42:19 -05:00
Randall Morey 4ae5e73def Merge branch 'main' into feature-oidc-authenticate 2021-02-26 09:59:27 -05:00
Randall Morey 3107a7e36e Merge pull request #481 from hashicorp/chore-update-artifact-name
Update application and macOS asset names to "Boundary"
2021-02-26 09:59:01 -05:00
Randall Morey 78505c720f Merge branch 'main' into feature-oidc-authenticate 2021-02-26 09:47:25 -05:00
Randall Morey 491720de4a Merge branch 'main' into chore-update-artifact-name 2021-02-26 09:46:17 -05:00
99 8791462e3e Merge pull request #475 from hashicorp/fix-release-gh-action
fix ui-release-trigger quoting issue
2021-02-25 22:43:03 -08:00
99 3b33256d4a Merge branch 'main' into fix-release-gh-action 2021-02-25 22:27:38 -08:00
Susmitha Girumala fe9ec32b8e Merge pull request #484 from hashicorp/chore-brand-color
chore: 🤖 tweak desktop svg bg accent color to match brand
2021-02-25 17:07:25 -05:00
Susmitha Girumala f94ab2b75e Merge branch 'main' into chore-brand-color 2021-02-25 16:56:07 -05:00
Randall Morey 740964f66f chore: 🤖 tweak desktop svg bg accent color to match brand 2021-02-25 12:58:17 -05:00
Randall Morey 12751fec06 Merge branch 'main' into chore-support-cli-json-updates 2021-02-25 12:55:27 -05:00
Randall Morey 38acced902 chore: 🤖 support api_errors and drop errors format flag 2021-02-25 12:35:57 -05:00
Susmitha Girumala b8eb690a4e Merge pull request #482 from hashicorp/chore-scrolling
Chore scrolling
2021-02-25 09:04:56 -05:00
Randall Morey 9dfb07e1cd docs: move scrolling changelog entry to new and improved section 2021-02-24 10:53:17 -05:00
Randall Morey 32b6410618 docs: add changelog PR link 2021-02-24 10:52:08 -05:00
Randall Morey d61faa9338 docs: add scrolling changelog entry 2021-02-24 10:50:32 -05:00
Randall Morey 80d6eda228 style: 💄 scroll only within columns so header remains visible 2021-02-24 10:49:19 -05:00
Randall Morey c6fd966372 docs: language tweak 2021-02-23 17:19:26 -05:00
Randall Morey b861352389 docs: add changelog entry for app name change 2021-02-23 17:13:30 -05:00
Susmitha Girumala 6591b88e7f Merge branch 'main' into chore-update-artifact-name 2021-02-23 17:06:48 -05:00
Susmitha Girumala ae6eb97bc0 Merge pull request #480 from hashicorp/refactor-electron-net-request
Use Electron net request
2021-02-23 17:05:13 -05:00
Randall Morey a0f8e0d2ae docs: tweak readme filename casing 2021-02-23 17:01:11 -05:00
Randall Morey 2b77c25238 chore: update readme regarding name change 2021-02-23 16:56:10 -05:00
Randall Morey 6f5e2ce2e9 chore: 🤖 change macos user-facing app name to "Boundary"
also update asset filenames to "Boundary"
2021-02-23 16:55:49 -05:00
Sam Salisbury 6fcaf8e950 Merge branch 'main' into fix-release-gh-action 2021-02-23 11:15:13 +00:00
Randall Morey 388a146cda chore: update changelog 2021-02-22 15:24:16 -05:00
Randall Morey 6f9fa06d11 chore: 🤖 remove axios dependency 2021-02-22 15:18:01 -05:00
Randall Morey 25a0e1cbbc refactor: 💡 use electron's net request instead of axios 2021-02-22 15:07:44 -05:00
Randall Morey 09c8680ff2 Merge branch 'main' into feature-oidc-authenticate 2021-02-18 15:54:23 -05:00
Susmitha Girumala 02996c62d8 Merge pull request #479 from hashicorp/chore-resolutions
chore: 🤖 upgrade resolutions for dependabot
2021-02-18 15:35:19 -05:00
Randall Morey 5f6dfa61c4 chore: 🤖 upgrade resolutions for dependabot 2021-02-18 15:00:12 -05:00
Susmitha Girumala 7153e7c18b Merge pull request #478 from hashicorp/chore-dependabot-alerts
chore: 🤖 rerun yarn install to update deps
2021-02-18 11:27:49 -05:00
Randall Morey 00c5e9a4ad chore: 🤖 rerun yarn install to update deps 2021-02-18 11:13:16 -05:00
Randall Morey 595d79cf24 Merge branch 'main' into fix-release-gh-action 2021-02-18 09:26:50 -05:00
Randall Morey de5c81bda0 Merge pull request #477 from hashicorp/macos-assets
Updated macOS assets
2021-02-17 17:42:31 -05:00
Randall Morey 811d1dbe32 Merge branch 'main' into feature-oidc-authenticate 2021-02-17 15:33:44 -05:00
Hector Simpson 675a24996a Update productName 2021-02-17 19:23:45 +00:00
Hector Simpson 3dac3b3d09 Update macOS assets, set distinct disk icon 2021-02-17 19:23:45 +00:00
Susmitha Girumala f2229c0486 Merge branch 'main' into fix-release-gh-action 2021-02-16 15:17:42 -05:00
Susmitha Girumala a6355aacfc Merge pull request #476 from hashicorp/docs-changelog
docs: add changelog
2021-02-16 15:17:13 -05:00
Randall Morey 7e1b2b1c4c fix: correct changelog entry 2021-02-16 14:17:49 -05:00
Randall Morey 139d9a0e95 docs: move changelog to desktop folder 2021-02-16 14:15:48 -05:00
Randall Morey 404c74ebf0 docs: add changelog 2021-02-16 13:59:19 -05:00
Randall Morey dbe7003068 chore: 🤖 manual merge from main 2021-02-16 13:38:48 -05:00
Sam Salisbury 7333f06428 fix ui-release-trigger quoting issue 2021-02-16 17:22:59 +00:00
Randall Morey bf2650f58f Merge pull request #474 from hashicorp/release-trigger
Creating empty commit to trigger release
2021-02-16 11:53:54 -05:00
Susmitha Girumala a3311cf8c5 Creating empty commit to trigger release 2021-02-16 11:42:43 -05:00
Randall Morey 05709f7ee5 Merge branch 'main' into feature-oidc-authenticate 2021-01-25 15:50:10 -05:00
Randall Morey 3084d6cf06 feature: initial OIDC authentication flow 2021-01-22 17:01:12 -05:00
Randall Morey ac92575b36 chore: setup initial oidc polling route (polling to come) 2021-01-22 10:34:05 -05:00
Randall Morey 900f342894 chore: 🤖 move method template to index to make room for oidc 2021-01-21 18:19:03 -05:00
Randall Morey 2f3478d043 feat: 🎸 initial flow to open new window to 3rd party auth 2021-01-21 14:26:02 -05:00
Randall Morey af8947dc62 chore: add mock authenticate:start endpoint 2021-01-19 15:43:45 -05:00
Randall Morey a3c12b36e7 refactor: 💡 mock authenticate should handle multiple auth types 2021-01-15 17:32:30 -05:00
Randall Morey 92640b96aa wip: OIDC authenticator 2021-01-15 11:10:33 -05:00
562 changed files with 12804 additions and 7990 deletions

No files matched your search

+3 -1
View File
@@ -1,5 +1,5 @@
name: Validate Monorepo
on: [push]
on: pull_request
jobs:
compliance:
@@ -39,6 +39,7 @@ jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
@@ -56,6 +57,7 @@ jobs:
test:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
@@ -0,0 +1,23 @@
name: "Trigger Test Boundary UI release"
on:
workflow_dispatch:
inputs:
branch:
description: Please use tag-like format n.n.n-someword (1.111.11-beta)
required: true
jobs:
trigger-circleci-release:
runs-on: ubuntu-latest
steps:
- name: Trigger Release job
if: github.event_name == 'workflow_dispatch'
run: |
echo "Triggering Test release using BRANCH and TEST_TAG ${{ github.event.inputs.branch }}"
curl -u ${{ secrets.CIRCLE_TOKEN }}: -X POST --header "Content-Type: application/json" \
-d '{ "branch": "main", "parameters": {"TAG": "'${{ github.event.inputs.branch }}'" }}' \
https://circleci.com/api/v2/project/github/hashicorp/boundary-ui-releases/pipeline
+4 -5
View File
@@ -9,12 +9,11 @@ jobs:
trigger-circleci-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- uses: actions/checkout@v2
- name: Trigger Release job
env:
TAG: ${{ github.event.release.tag_name }}
run: |
echo "Triggering release with a TAG ${GITHUB_REF#refs/tags/}"
curl -u ${{ secrets.CIRCLE_TOKEN }}: -X POST --header "Content-Type: application/json" \
-d '{ "branch": "main", "parameters": {"TAG": "${TAG}" }}' \
-d '{ "branch": "main", "parameters": {"TAG": "'${GITHUB_REF#refs/tags/}'" }}' \
https://circleci.com/api/v2/project/github/hashicorp/boundary-ui-releases/pipeline
+6
View File
@@ -0,0 +1,6 @@
# Contributing to Boundary
Thank you for contributing to Boundary! Here you can find common questions around reporting issues and opening
pull requests to our project.
When contributing in any way to the Boundary project (new issue, PR, etc), please be aware that our team identifies with many gender pronouns and to use non-binary pronouns when addressing our team. For more reading on our code of conduct, please see the [HashiCorp community guidelines](https://www.hashicorp.com/community-guidelines).
+32 -1
View File
@@ -24,6 +24,9 @@ subproject, e.g. running or testing.
- [Building Admin UI for Production](#building-admin-ui-for-production)
- [Building with a Container](#building-with-a-container)
- [Building Desktop UI for Production](#building-desktop-ui-for-production)
- [Connect Boundary UI to Boundary local instance](#connect-boundary-ui-to-boundary-local-instance)
- [For admin](#for-admin)
- [For desktop](#for-desktop)
- [Committing](#committing)
- [License Checking](#license-checking)
@@ -35,6 +38,9 @@ You will need the following things properly installed on your computer.
* [Git][git]
* [Node.js][node]
* v10–v15
* **Apple Silicon Users**: if you experience problems building or running
Boundary UIs, try Node v15.
* [Yarn][yarn] installed globally
* [Google Chrome][chrome]
* [Firefox][firefox]
@@ -120,7 +126,32 @@ To provide a signing identify for macOS build, use `BOUNDARY_DESKTOP_SIGNING_IDE
environment variable to set signing certificate name (e.g Developer ID Application: * (*)).
Assets are saved to `ui/desktop/electron-app/out/make/`.
DMG packaged desktop UI is available at asset location as `Boundary Desktop.dmg`.
DMG packaged desktop UI is available at asset location as `boundary.dmg`.
### Connect Boundary UI to Boundary local instance
This describes how to connect local Boundary UI to your local instance of Boundary.
This assumes you already have up and running a Boundary dev instance in your local environment with a listener `127.0.0.1:9200` (default behaviour). [Learn how to start a local Boundary dev instance](https://learn.hashicorp.com/tutorials/boundary/getting-started-dev?in=boundary/getting-started#start-a-dev-environment).
#### For admin
This assumes you are within `boundary-ui/ui/admin`.
You will need to turn `off` mirage, tell the UI where to find Boundary and run it: `$ ENABLE_MIRAGE=false API_HOST=http://localhost:9200 yarn start`.
Following terminal instructions, open in your browser: `http://localhost:4200/`.
Once you open the UI you will see the login screen, authenticate using generated admin login name and password.
#### For desktop
This assumes you are within `boundary-ui/ui/desktop`.
You will need to turn `off` mirage and run it: `$ ENABLE_MIRAGE=false yarn start:desktop`.
In login screen, authenticate using generated admin login name and password.
Enter the origin of your Boundary dev instance, by default is: `http://localhost:9200`.
### Committing
+1
View File
@@ -13,6 +13,7 @@
# misc
/coverage/
!.*
.eslintcache
# ember-try
/.node_modules.ember-try/
+21 -15
View File
@@ -7,48 +7,54 @@ module.exports = {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true
}
legacyDecorators: true,
},
},
plugins: [
'ember'
],
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true
browser: true,
},
rules: {
'ember/no-get': 'off',
'ember/no-get-with-default': 'off',
'ember/no-computed-properties-in-native-classes': 'off',
'ember/no-assignment-of-untracked-properties-used-in-tracking-contexts':
'off',
},
rules: {},
overrides: [
// node files
{
files: [
'.eslintrc.js',
'.prettierrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'index.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'tests/dummy/config/**/*.js'
'tests/dummy/config/**/*.js',
],
excludedFiles: [
'addon/**',
'addon-test-support/**',
'app/**',
'tests/dummy/app/**'
'tests/dummy/app/**',
],
parserOptions: {
sourceType: 'script'
sourceType: 'script',
},
env: {
browser: false,
node: true
node: true,
},
plugins: ['node'],
extends: ['plugin:node/recommended']
}
]
extends: ['plugin:node/recommended'],
},
],
};
+1
View File
@@ -10,6 +10,7 @@
/.editorconfig
/.ember-cli
/.env*
/.eslintcache
/.eslintignore
/.eslintrc.js
/.git/
@@ -1,4 +1,6 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# unconventional js
/blueprints/*/files/
/vendor/
# compiled output
/dist/
@@ -9,15 +11,9 @@
/node_modules/
# misc
/.env*
/.pnp*
/.sass-cache
/connect.lock
/coverage/
/libpeerconnection.log
/npm-debug.log*
/testem.log
/yarn-error.log
!.*
.eslintcache
# ember-try
/.node_modules.ember-try/
+5
View File
@@ -0,0 +1,5 @@
'use strict';
module.exports = {
singleQuote: true,
};
+1 -1
View File
@@ -1,5 +1,5 @@
'use strict';
module.exports = {
extends: 'octane'
extends: 'octane',
};
+2 -2
View File
@@ -3,7 +3,7 @@ import { serializeIntoHash } from '@ember-data/adapter/-private';
/* eslint-disable-next-line ember/no-mixins */
import AdapterBuildURLMixin from '../mixins/adapter-build-url';
import config from 'ember-get-config';
import { get, getWithDefault } from '@ember/object';
import { get } from '@ember/object';
import { InvalidError } from '@ember-data/adapter/error';
import { dasherize } from '@ember/string';
import { pluralize } from 'ember-inflector';
@@ -69,7 +69,7 @@ export default class ApplicationAdapter extends RESTAdapter.extend(
* @return {string}
*/
urlSuffix(modelName, id, snapshot = {}) {
const method = getWithDefault(snapshot, 'adapterOptions.method', '');
const method = get(snapshot, 'adapterOptions.method') || '';
return method ? `:${method}` : '';
}
@@ -7,6 +7,12 @@ import { attr } from '@ember-data/model';
export default class GeneratedAuthMethodModel extends BaseModel {
// =attributes
@attr('boolean', {
description: 'Specifies if this is the primary auth method for its scope.',
readOnly: true,
})
is_primary;
@attr('string', {
description: 'The type of the resource, to help differentiate schemas',
})
+2 -1
View File
@@ -18,7 +18,8 @@ export default class GeneratedRoleModel extends BaseModel {
description;
@attr('string', {
description: 'The scope to which this role applies. Defaults to the role\'s scope.',
description:
"The scope to which this role applies. Defaults to the role's scope.",
})
grant_scope_id;
@@ -7,6 +7,12 @@ import { attr } from '@ember-data/model';
export default class GeneratedScopeModel extends BaseModel {
// =attributes
@attr('string', {
description:
'The ID of the primary auth method for this scope. A primary auth method\nis allowed to vivify users when new accounts are created and is the source for the users account info.',
})
primary_auth_method_id;
@attr('string', {
description: 'The type of the resource',
})
@@ -2,7 +2,6 @@ import BaseModel from '../../models/base';
import { attr } from '@ember-data/model';
export default class GeneratedSessionModel extends BaseModel {
// =attributes
@attr('string') user_id;
@@ -32,5 +31,4 @@ export default class GeneratedSessionModel extends BaseModel {
description: 'Current version number of this resource.',
})
version;
}
+2 -2
View File
@@ -24,13 +24,13 @@ export default class GeneratedTargetModel extends BaseModel {
@attr('number', {
description: '',
defaultValue: 28800
defaultValue: 28800,
})
session_max_seconds;
@attr('number', {
description: '',
defaultValue: 1
defaultValue: 1,
})
session_connection_limit;
-1
View File
@@ -4,7 +4,6 @@ import { computed } from '@ember/object';
import { equal } from '@ember/object/computed';
export default class AccountModel extends GeneratedAccountModel {
// =attributes
/**
+23 -1
View File
@@ -1,3 +1,25 @@
import GeneratedAuthMethodModel from '../generated/models/auth-method';
import { equal } from '@ember/object/computed';
export default class AuthMethodModel extends GeneratedAuthMethodModel {}
export default class AuthMethodModel extends GeneratedAuthMethodModel {
// =attributes
/**
* @type {boolean}
*/
@equal('is_primary', true) isPrimary;
/**
* @type {boolean}
*/
get isPassword() {
return this.type === 'password';
}
/**
* @type {boolean}
*/
get isOIDC() {
return this.type === 'oidc';
}
}
-1
View File
@@ -25,7 +25,6 @@ import { computed } from '@ember/object';
* 2) Or as an ID: `record.scopeID`.
*/
export default class BaseModel extends Model {
// =relationships
/**
-1
View File
@@ -2,7 +2,6 @@ import GeneratedHostSetModel from '../generated/models/host-set';
import { fragmentArray } from 'ember-data-model-fragments/attributes';
export default class HostSetModel extends GeneratedHostSetModel {
// =attributes
/**
-2
View File
@@ -2,11 +2,9 @@ import GeneratedHostModel from '../generated/models/host';
import { fragment } from 'ember-data-model-fragments/attributes';
export default class HostModel extends GeneratedHostModel {
/**
* Attributes of this resource, if any, represented as a JSON fragment.
* @type {FragmentHostAttributesModel}
*/
@fragment('fragment-host-attributes', { defaultValue: {} }) attributes;
}
+1 -1
View File
@@ -35,7 +35,7 @@ export default class RoleModel extends GeneratedRoleModel {
return this.save({
adapterOptions: {
method: 'set-grants',
grantStrings
grantStrings,
},
});
}
-2
View File
@@ -4,7 +4,6 @@ import { equal } from '@ember/object/computed';
import { attr } from '@ember-data/model';
export default class SessionModel extends GeneratedSessionModel {
// =attributes
@attr('string', { readOnly: true }) proxy_address;
@@ -61,5 +60,4 @@ export default class SessionModel extends GeneratedSessionModel {
},
});
}
}
+6 -4
View File
@@ -41,8 +41,9 @@ export default class TargetModel extends GeneratedTargetModel {
* @type {SessionModel[]}
*/
get sessions() {
return this.store.peekAll('session')
.filter(s => s && (s.target_id === this.id));
return this.store
.peekAll('session')
.filter((s) => s && s.target_id === this.id);
}
/**
@@ -58,8 +59,9 @@ export default class TargetModel extends GeneratedTargetModel {
* @type {boolean}
*/
get isActive() {
const pendingOrActiveSessions =
this.sessions.filter(s => s.isActive || s.isPending);
const pendingOrActiveSessions = this.sessions.filter(
(s) => s.isActive || s.isPending
);
return Boolean(pendingOrActiveSessions.length);
}
-2
View File
@@ -3,7 +3,6 @@ import { attr } from '@ember-data/model';
import { A } from '@ember/array';
export default class UserModel extends GeneratedUserModel {
// =attributes
/**
@@ -74,5 +73,4 @@ export default class UserModel extends GeneratedUserModel {
removeAccount(accountID, options) {
return this.removeAccounts([accountID], options);
}
}
-1
View File
@@ -1,7 +1,6 @@
import ApplicationSerializer from './application';
export default class AccountSerializer extends ApplicationSerializer {
// =properties
/**
+1 -2
View File
@@ -7,7 +7,6 @@ import { copy } from 'ember-copy';
* Manages serialization/normalization of data to/from the API.
*/
export default class ApplicationSerializer extends RESTSerializer {
// =properties
/**
@@ -82,7 +81,7 @@ export default class ApplicationSerializer extends RESTSerializer {
// Delete `scope` field
delete serialized.scope;
// And serialize `scope_id`
if(this.serializeScopeID) {
if (this.serializeScopeID) {
const scope_id = snapshot?.attr('scope')?.attr('scope_id');
if (scope_id) serialized.scope_id = scope_id;
}
@@ -0,0 +1,35 @@
import ApplicationSerializer from './application';
export default class AuthMethodSerializer extends ApplicationSerializer {
/**
* Sorts the array in order of "is_primary" such that the primary method
* appears first. The "natural" order of auth methods places primary first.
*
* @override
* @return {object}
*/
normalizeArrayResponse() {
const normalized = super.normalizeArrayResponse(...arguments);
normalized.data = normalized.data.sort((a) =>
a.attributes.is_primary ? -1 : 1
);
return normalized;
}
/**
* Sets `is_primary` to `false` if it is missing in the response. The API
* omits "zero" values per:
* https://developers.google.com/protocol-buffers/docs/proto3#default
*
* TODO: generalize this so that all zero values are reified.
* @override
* @return {object}
*/
normalize() {
const normalized = super.normalize(...arguments);
if (!normalized.data.attributes.is_primary) {
normalized.data.attributes.is_primary = false;
}
return normalized;
}
}
-1
View File
@@ -1,7 +1,6 @@
import ApplicationSerializer from './application';
export default class HostSetSerializer extends ApplicationSerializer {
// =properties
/**
-2
View File
@@ -1,12 +1,10 @@
import ApplicationSerializer from './application';
export default class HostSerializer extends ApplicationSerializer {
// =properties
/**
* @type {boolean}
*/
serializeScopeID = false;
}
+3 -3
View File
@@ -17,8 +17,8 @@ export default class RoleSerializer extends ApplicationSerializer {
serialize(snapshot) {
const grantStrings = get(snapshot, 'adapterOptions.grantStrings');
let serialized = super.serialize(...arguments);
if (grantStrings) serialized =
this.serializeWithGrantStrings(snapshot, grantStrings);
if (grantStrings)
serialized = this.serializeWithGrantStrings(snapshot, grantStrings);
const principalIDs = snapshot?.adapterOptions?.principalIDs;
if (principalIDs)
serialized = this.serializewithPrincipals(snapshot, principalIDs);
@@ -34,7 +34,7 @@ export default class RoleSerializer extends ApplicationSerializer {
serializeWithGrantStrings(snapshot, grantStrings) {
return {
version: snapshot.attr('version'),
grant_strings: grantStrings
grant_strings: grantStrings,
};
}
+2 -2
View File
@@ -13,8 +13,8 @@ export default class UserSerializer extends ApplicationSerializer {
serialize(snapshot) {
let serialized = super.serialize(...arguments);
const accountIDs = snapshot?.adapterOptions?.accountIDs;
if (accountIDs) serialized =
this.serializewithAccounts(snapshot, accountIDs);
if (accountIDs)
serialized = this.serializewithAccounts(snapshot, accountIDs);
return serialized;
}
@@ -0,0 +1 @@
export { default } from 'api/serializers/auth-method';
+6 -6
View File
@@ -25,9 +25,9 @@ module.exports = async function () {
name: 'ember-lts-3.20',
npm: {
devDependencies: {
'ember-source': '~3.20.5'
}
}
'ember-source': '~3.20.5',
},
},
},
{
name: 'ember-release',
@@ -62,9 +62,9 @@ module.exports = async function () {
},
npm: {
devDependencies: {
'@ember/jquery': '^1.1.0'
}
}
'@ember/jquery': '^1.1.0',
},
},
},
{
name: 'ember-classic',
+284 -224
View File
@@ -5,8 +5,7 @@ import { pickRandomStatusString } from './factories/session';
import { Response } from 'miragejs';
import initializeMockIPC from './scenarios/ipc';
export default function() {
export default function () {
initializeMockIPC(this);
// make this `http://localhost:8080`, for example, if your API is on a different server
@@ -23,17 +22,20 @@ export default function() {
// Scope resources
this.get('/scopes', ({ scopes }, { queryParams: { scope_id, recursive } }) => {
// Default parent scope is global
if (!scope_id) scope_id = 'global';
if (recursive && scope_id === 'global') {
return scopes.all();
} else {
return scopes.where(scope => {
return scope.scope ? scope.scope.id === scope_id : false
});
this.get(
'/scopes',
({ scopes }, { queryParams: { scope_id, recursive } }) => {
// Default parent scope is global
if (!scope_id) scope_id = 'global';
if (recursive && scope_id === 'global') {
return scopes.all();
} else {
return scopes.where((scope) => {
return scope.scope ? scope.scope.id === scope_id : false;
});
}
}
});
);
this.post('/scopes', function ({ scopes }) {
// Parent scope comes through the payload via `scope_id`, but this needs
// to be expanded to a scope object `scope: {id:..., type:...}` before
@@ -49,41 +51,60 @@ export default function() {
// Auth & IAM resources
this.get('/auth-methods', ({ authMethods }, { queryParams: { scope_id: scopeId } }) => {
return authMethods.where({ scopeId });
});
this.get(
'/auth-methods',
({ authMethods }, { queryParams: { scope_id: scopeId } }) => {
return authMethods.where({ scopeId });
}
);
this.post('/auth-methods');
this.get('/auth-methods/:id');
this.patch('/auth-methods/:id');
this.del('/auth-methods/:id');
this.del('/auth-methods/:id', ({ authMethods }, { params: { id } }) => {
const authMethod = authMethods.find(id);
const scope = authMethod.scope;
authMethod.destroy();
// If the primary auth method is deleted, the associated scope's
// primary_auth_method_id field should be set to null.
if (scope.primaryAuthMethodId === id) {
scope.update({ primaryAuthMethodId: null });
}
return new Response(202);
});
// Auth Method Accounts
this.get('/accounts', ({ accounts }, { queryParams: { auth_method_id: authMethodId } }) => {
return accounts.where({ authMethodId });
});
this.get(
'/accounts',
({ accounts }, { queryParams: { auth_method_id: authMethodId } }) => {
return accounts.where({ authMethodId });
}
);
this.post('/accounts');
this.get('/accounts/:id');
this.patch('/accounts/:id');
this.del('/accounts/:id');
this.post('/accounts/:idMethod', function ({ accounts }, { params: { idMethod } }) {
const attrs = this.normalizedRequestAttrs();
const id = idMethod.split(':')[0];
const method = idMethod.split(':')[1];
const account = accounts.find(id);
const updatedAttrs = {
version: attrs.version,
attributes: account.attributes
};
// Set new password
if (method === 'set-password') {
updatedAttrs.attributes.password = attrs.password;
this.post(
'/accounts/:idMethod',
function ({ accounts }, { params: { idMethod } }) {
const attrs = this.normalizedRequestAttrs();
const id = idMethod.split(':')[0];
const method = idMethod.split(':')[1];
const account = accounts.find(id);
const updatedAttrs = {
version: attrs.version,
attributes: account.attributes,
};
// Set new password
if (method === 'set-password') {
updatedAttrs.attributes.password = attrs.password;
}
// Set new password
if (method === 'change-password') {
updatedAttrs.attributes.password = attrs.new_password;
}
return account.update(updatedAttrs);
}
// Set new password
if (method === 'change-password') {
updatedAttrs.attributes.password = attrs.new_password;
}
return account.update(updatedAttrs);
});
);
// Authenticate/deauthenticate routes
this.post('/auth-methods/:id_method', authHandler);
@@ -104,11 +125,11 @@ export default function() {
const user = users.find(id);
const updatedAttrs = {
version: attrs.version,
accountIds: user.accountIds
accountIds: user.accountIds,
};
// If adding accounts, push them into the array
if (method === 'add-accounts') {
attrs.accountIds.forEach(id => {
attrs.accountIds.forEach((id) => {
if (!updatedAttrs.accountIds.includes(id)) {
updatedAttrs.accountIds.push(id);
}
@@ -116,7 +137,7 @@ export default function() {
}
// If deleting accounts, filter them out of the array
if (method === 'remove-accounts') {
updatedAttrs.accountIds = updatedAttrs.accountIds.filter(id => {
updatedAttrs.accountIds = updatedAttrs.accountIds.filter((id) => {
return !attrs.accountIds.includes(id);
});
}
@@ -131,31 +152,34 @@ export default function() {
this.get('/groups/:id');
this.patch('/groups/:id');
this.del('/groups/:id');
this.post('/groups/:idMethod', function ({ groups }, { params: { idMethod } }) {
const attrs = this.normalizedRequestAttrs();
const id = idMethod.split(':')[0];
const method = idMethod.split(':')[1];
const group = groups.find(id);
const updatedAttrs = {
version: attrs.version,
memberIds: group.memberIds
};
// If adding members, push them into the array
if (method === 'add-members') {
attrs.memberIds.forEach(id => {
if (!updatedAttrs.memberIds.includes(id)) {
updatedAttrs.memberIds.push(id);
}
});
this.post(
'/groups/:idMethod',
function ({ groups }, { params: { idMethod } }) {
const attrs = this.normalizedRequestAttrs();
const id = idMethod.split(':')[0];
const method = idMethod.split(':')[1];
const group = groups.find(id);
const updatedAttrs = {
version: attrs.version,
memberIds: group.memberIds,
};
// If adding members, push them into the array
if (method === 'add-members') {
attrs.memberIds.forEach((id) => {
if (!updatedAttrs.memberIds.includes(id)) {
updatedAttrs.memberIds.push(id);
}
});
}
// If deleting members, filter them out of the array
if (method === 'remove-members') {
updatedAttrs.memberIds = updatedAttrs.memberIds.filter((id) => {
return !attrs.memberIds.includes(id);
});
}
return group.update(updatedAttrs);
}
// If deleting members, filter them out of the array
if (method === 'remove-members') {
updatedAttrs.memberIds = updatedAttrs.memberIds.filter(id => {
return !attrs.memberIds.includes(id);
});
}
return group.update(updatedAttrs);
});
);
// IAM: Roles
this.get('/roles', ({ roles }, { queryParams: { scope_id: scopeId } }) => {
@@ -165,66 +189,72 @@ export default function() {
this.get('/roles/:id');
this.patch('/roles/:id');
this.del('/roles/:id');
this.post('/roles/:idMethod', function ({ roles, users, groups }, { params: { idMethod } }) {
const attrs = this.normalizedRequestAttrs();
const id = idMethod.split(':')[0];
const method = idMethod.split(':')[1];
const role = roles.find(id);
let updatedAttrs = {};
this.post(
'/roles/:idMethod',
function ({ roles, users, groups }, { params: { idMethod } }) {
const attrs = this.normalizedRequestAttrs();
const id = idMethod.split(':')[0];
const method = idMethod.split(':')[1];
const role = roles.find(id);
let updatedAttrs = {};
// Principals is a combined list of users and groups, but in Mirage we've
// internally modelled them as separate lists. Therefore we must check
// the type by looking up the user or group first, then determine which
// list to add the principal to.
if (method === 'add-principals') {
updatedAttrs = {
version: attrs.version,
userIds: role.userIds,
groupIds: role.groupIds
};
attrs.principalIds.forEach(id => {
const isUser = users.find(id);
const isGroup = groups.find(id);
if (isUser && !updatedAttrs.userIds.includes(id)) {
updatedAttrs.userIds.push(id);
}
if (isGroup && !updatedAttrs.groupIds.includes(id)) {
updatedAttrs.groupIds.push(id);
}
});
}
// If deleting principals, filter them out of both users and groups,
// and in this case don't care about the type
if (method === 'remove-principals') {
updatedAttrs = {
version: attrs.version,
userIds: role.userIds,
groupIds: role.groupIds
};
updatedAttrs.userIds = updatedAttrs.userIds.filter(id => {
return !attrs.principalIds.includes(id);
});
updatedAttrs.groupIds = updatedAttrs.groupIds.filter(id => {
return !attrs.principalIds.includes(id);
});
}
// Principals is a combined list of users and groups, but in Mirage we've
// internally modelled them as separate lists. Therefore we must check
// the type by looking up the user or group first, then determine which
// list to add the principal to.
if (method === 'add-principals') {
updatedAttrs = {
version: attrs.version,
userIds: role.userIds,
groupIds: role.groupIds,
};
attrs.principalIds.forEach((id) => {
const isUser = users.find(id);
const isGroup = groups.find(id);
if (isUser && !updatedAttrs.userIds.includes(id)) {
updatedAttrs.userIds.push(id);
}
if (isGroup && !updatedAttrs.groupIds.includes(id)) {
updatedAttrs.groupIds.push(id);
}
});
}
// If deleting principals, filter them out of both users and groups,
// and in this case don't care about the type
if (method === 'remove-principals') {
updatedAttrs = {
version: attrs.version,
userIds: role.userIds,
groupIds: role.groupIds,
};
updatedAttrs.userIds = updatedAttrs.userIds.filter((id) => {
return !attrs.principalIds.includes(id);
});
updatedAttrs.groupIds = updatedAttrs.groupIds.filter((id) => {
return !attrs.principalIds.includes(id);
});
}
if (method === 'set-grants') {
updatedAttrs = {
version: attrs.version,
grantStrings: attrs.grantStrings
};
}
if (method === 'set-grants') {
updatedAttrs = {
version: attrs.version,
grantStrings: attrs.grantStrings,
};
}
return role.update(updatedAttrs);
});
return role.update(updatedAttrs);
}
);
// Other resources
// host-catalog
this.get('/host-catalogs', ({ hostCatalogs }, { queryParams: { scope_id: scopeId } }) => {
return hostCatalogs.where({ scopeId });
});
this.get(
'/host-catalogs',
({ hostCatalogs }, { queryParams: { scope_id: scopeId } }) => {
return hostCatalogs.where({ scopeId });
}
);
this.post('/host-catalogs');
this.get('/host-catalogs/:id');
this.patch('/host-catalogs/:id');
@@ -232,9 +262,12 @@ export default function() {
// host
this.get('/hosts', function ({ hosts }, { queryParams: { host_catalog_id: hostCatalogId } }) {
return hosts.where({ hostCatalogId });
});
this.get(
'/hosts',
function ({ hosts }, { queryParams: { host_catalog_id: hostCatalogId } }) {
return hosts.where({ hostCatalogId });
}
);
this.post('/hosts', function ({ hostCatalogs, hosts }) {
const attrs = this.normalizedRequestAttrs();
const hostCatalog = hostCatalogs.find(attrs.hostCatalogId);
@@ -247,9 +280,15 @@ export default function() {
// host-set
this.get('/host-sets', function ({ hostSets }, { queryParams: { host_catalog_id: hostCatalogId } }) {
return hostSets.where({ hostCatalogId });
});
this.get(
'/host-sets',
function (
{ hostSets },
{ queryParams: { host_catalog_id: hostCatalogId } }
) {
return hostSets.where({ hostCatalogId });
}
);
this.post('/host-sets', function ({ hostCatalogs, hostSets }) {
const attrs = this.normalizedRequestAttrs();
const hostCatalog = hostCatalogs.find(attrs.hostCatalogId);
@@ -259,49 +298,57 @@ export default function() {
this.get('/host-sets/:id');
this.patch('/host-sets/:id');
this.del('/host-sets/:id');
this.post('/host-sets/:idMethod', function ({ hostSets }, { params: { idMethod } }) {
const attrs = this.normalizedRequestAttrs();
const id = idMethod.split(':')[0];
const method = idMethod.split(':')[1];
const hostSet = hostSets.find(id);
const updatedAttrs = {
version: attrs.version,
hostIds: hostSet.hostIds
}
this.post(
'/host-sets/:idMethod',
function ({ hostSets }, { params: { idMethod } }) {
const attrs = this.normalizedRequestAttrs();
const id = idMethod.split(':')[0];
const method = idMethod.split(':')[1];
const hostSet = hostSets.find(id);
const updatedAttrs = {
version: attrs.version,
hostIds: hostSet.hostIds,
};
// If adding hosts, push them into the array
if(method === 'add-hosts') {
attrs.hostIds.forEach(id => {
if(!updatedAttrs.hostIds.includes(id)) {
updatedAttrs.hostIds.push(id);
}
})
}
// If adding hosts, push them into the array
if (method === 'add-hosts') {
attrs.hostIds.forEach((id) => {
if (!updatedAttrs.hostIds.includes(id)) {
updatedAttrs.hostIds.push(id);
}
});
}
// If deleting hosts, filter them out of the array
if (method === 'remove-hosts') {
updatedAttrs.hostIds = updatedAttrs.hostIds.filter(id => {
return !attrs.hostIds.includes(id);
});
}
// If deleting hosts, filter them out of the array
if (method === 'remove-hosts') {
updatedAttrs.hostIds = updatedAttrs.hostIds.filter((id) => {
return !attrs.hostIds.includes(id);
});
}
return hostSet.update(updatedAttrs);
});
return hostSet.update(updatedAttrs);
}
);
// target
this.get('/targets', function ({ targets }, { queryParams: { scope_id, recursive } }) {
if (recursive && scope_id === 'global') {
return targets.all();
} else if (recursive) {
return targets.where(target => {
const targetModel = targets.find(target.id);
return (target.scopeId === scope_id)
|| (targetModel?.scope?.scope?.id === scope_id)
});
this.get(
'/targets',
function ({ targets }, { queryParams: { scope_id, recursive } }) {
if (recursive && scope_id === 'global') {
return targets.all();
} else if (recursive) {
return targets.where((target) => {
const targetModel = targets.find(target.id);
return (
target.scopeId === scope_id ||
targetModel?.scope?.scope?.id === scope_id
);
});
}
return targets.where((target) => target.scopeId === scope_id);
}
return targets.where(target => target.scopeId === scope_id);
});
);
this.post('/targets', function ({ targets }) {
const attrs = this.normalizedRequestAttrs();
return targets.create(attrs);
@@ -309,83 +356,96 @@ export default function() {
this.get('/targets/:id');
this.patch('/targets/:id');
this.del('/targets/:id');
this.post('/targets/:idMethod', function ({ targets }, { params: { idMethod } }) {
const attrs = this.normalizedRequestAttrs();
const id = idMethod.split(':')[0];
const method = idMethod.split(':')[1];
const target = targets.find(id);
const updatedAttrs = {
version: attrs.version,
hostSetIds: target.hostSetIds
};
// If adding host sets, push them into the array
if (method === 'add-host-sets') {
attrs.hostSetIds.forEach(id => {
if (!updatedAttrs.hostSetIds.includes(id)) {
updatedAttrs.hostSetIds.push(id);
}
});
this.post(
'/targets/:idMethod',
function ({ targets }, { params: { idMethod } }) {
const attrs = this.normalizedRequestAttrs();
const id = idMethod.split(':')[0];
const method = idMethod.split(':')[1];
const target = targets.find(id);
const updatedAttrs = {
version: attrs.version,
hostSetIds: target.hostSetIds,
};
// If adding host sets, push them into the array
if (method === 'add-host-sets') {
attrs.hostSetIds.forEach((id) => {
if (!updatedAttrs.hostSetIds.includes(id)) {
updatedAttrs.hostSetIds.push(id);
}
});
}
// If deleting host sets, filter them out of the array
if (method === 'remove-host-sets') {
updatedAttrs.hostSetIds = updatedAttrs.hostSetIds.filter((id) => {
return !attrs.hostSetIds.includes(id);
});
}
return target.update(updatedAttrs);
}
// If deleting host sets, filter them out of the array
if (method === 'remove-host-sets') {
updatedAttrs.hostSetIds = updatedAttrs.hostSetIds.filter(id => {
return !attrs.hostSetIds.includes(id);
});
}
return target.update(updatedAttrs);
});
);
// session
this.get('/sessions', function ({ sessions }, { queryParams: { scope_id, recursive } }) {
// To simulate changes to `session.status` that may occur in the backend,
// we quietly randomize the value of the field on GET.
// To populate sessions for logged in user,
// update alternate sessions to auth user.
// But only if not in testing mode.
// In tests, we need deterministic statuses.
if (!Ember.testing) {
sessions.all()
.models
.forEach(session => {
this.get(
'/sessions',
function ({ sessions }, { queryParams: { scope_id, recursive } }) {
// To simulate changes to `session.status` that may occur in the backend,
// we quietly randomize the value of the field on GET.
// To populate sessions for logged in user,
// update alternate sessions to auth user.
// But only if not in testing mode.
// In tests, we need deterministic statuses.
if (!Ember.testing) {
sessions.all().models.forEach((session) => {
session.update({
status: pickRandomStatusString()
});
if(session.id.split('-').pop() % 2) session.update({
userId: 'authenticateduser'
status: pickRandomStatusString(),
});
if (session.id.split('-').pop() % 2)
session.update({
userId: 'authenticateduser',
});
});
}
if (recursive && scope_id === 'global') {
return sessions.all();
} else if (recursive) {
return sessions.where((session) => {
const sessionModel = sessions.find(session.id);
return (
session.scopeId === scope_id ||
sessionModel?.scope?.scope?.id === scope_id
);
});
}
return sessions.where((session) => session.scopeId === scope_id);
}
if (recursive && scope_id === 'global') {
return sessions.all();
} else if (recursive) {
return sessions.where(session => {
const sessionModel = sessions.find(session.id);
return (session.scopeId === scope_id)
|| (sessionModel?.scope?.scope?.id === scope_id)
});
}
return sessions.where(session => session.scopeId === scope_id);
});
);
this.get('/sessions/:id', function ({ sessions }, { params: { id } }) {
const session = sessions.find(id);
return session.update({
status: pickRandomStatusString()
});
});
this.post('/sessions/:idMethod', function ({ sessions }, { params: { idMethod } }) {
const attrs = this.normalizedRequestAttrs();
const id = idMethod.split(':')[0];
const method = idMethod.split(':')[1];
const session = sessions.find(id);
const updatedAttrs = {
version: attrs.version
};
if (method === 'cancel') {
updatedAttrs.status = 'canceling';
if (!Ember.testing) {
session.update({
status: pickRandomStatusString(),
});
}
return session.update(updatedAttrs);
return session;
});
this.post(
'/sessions/:idMethod',
function ({ sessions }, { params: { idMethod } }) {
const attrs = this.normalizedRequestAttrs();
const id = idMethod.split(':')[0];
const method = idMethod.split(':')[1];
const session = sessions.find(id);
const updatedAttrs = {
version: attrs.version,
};
if (method === 'cancel') {
updatedAttrs.status = 'canceling';
}
return session.update(updatedAttrs);
}
);
// auth-tokens
+8 -4
View File
@@ -1,20 +1,24 @@
import factory from '../generated/factories/auth-method';
import { trait } from 'ember-cli-mirage';
const types = ['password', 'oidc'];
export default factory.extend({
id: (i) => `auth-method-id-${i}`,
// Cycle through available types
type: (i) => types[i % types.length],
/**
* Adds accounts (with associated users) to auth method.
*/
withAccountsAndUsers: trait({
afterCreate(authMethod, server) {
const { scope } = authMethod;
server.createList('user', 5, { scope }).map(user => {
server.createList('user', 5, { scope }).map((user) => {
const { id } = server.create('account', { scope, authMethod });
user.update({ accountIds: [id] });
});
}
})
},
}),
});
+2 -2
View File
@@ -13,6 +13,6 @@ export default factory.extend({
const scope = group.scope;
const members = server.createList('user', 2, { scope });
group.update({ members });
}
})
},
}),
});
+2 -4
View File
@@ -2,13 +2,11 @@ import factory from '../generated/factories/host-catalog';
import { trait } from 'ember-cli-mirage';
export default factory.extend({
withChildren: trait({
afterCreate(hostCatalog, server) {
const { scope } = hostCatalog;
const hosts = server.createList('host', 10, { scope, hostCatalog });
server.createList('host-set', 3, { scope, hostCatalog, hosts });
}
})
},
}),
});
+1 -1
View File
@@ -1,5 +1,5 @@
import factory from '../generated/factories/host-set';
export default factory.extend({
id: (i) => `host-set-id-${i}`
id: (i) => `host-set-id-${i}`,
});
+1 -1
View File
@@ -1,5 +1,5 @@
import factory from '../generated/factories/host';
export default factory.extend({
id: (i) => `host-id-${i}`
id: (i) => `host-id-${i}`,
});
+6 -6
View File
@@ -2,11 +2,10 @@ import factory from '../generated/factories/role';
import { trait } from 'ember-cli-mirage';
export default factory.extend({
// eslint-disable-next-line ember/avoid-leaking-state-in-ember-objects
grant_strings: () => [
'id=*;action=*',
'id=*;type=host-catalog;actions=create,read'
'id=*;type=host-catalog;actions=create,read',
],
/**
@@ -18,15 +17,16 @@ export default factory.extend({
const users = server.createList('user', 2, { scope });
const groups = server.createList('group', 2, { scope });
role.update({ users, groups });
}
},
}),
/**
* Set the grant scope ID to match the scope ID.
*/
afterCreate(role) {
const { scope: { id } } = role;
const {
scope: { id },
} = role;
role.update({ grant_scope_id: id });
}
},
});
+12 -9
View File
@@ -2,7 +2,6 @@ import factory from '../generated/factories/scope';
import { trait } from 'ember-cli-mirage';
export default factory.extend({
type: 'global',
/**
@@ -18,18 +17,22 @@ export default factory.extend({
withChildren: trait({
afterCreate(record, server) {
if (record.type === 'global') {
server.createList('scope', 1, {
type: 'org',
scope: { id: record.id, type: record.type }
}, 'withChildren');
server.createList(
'scope',
1,
{
type: 'org',
scope: { id: record.id, type: record.type },
},
'withChildren'
);
}
if (record.type === 'org') {
server.createList('scope', 3, {
type: 'project',
scope: { id: record.id, type: record.type }
scope: { id: record.id, type: record.type },
});
}
}
})
},
}),
});
+5 -11
View File
@@ -2,17 +2,11 @@ import factory from '../generated/factories/session';
import { trait } from 'ember-cli-mirage';
import { random } from 'faker';
const statusStrings = [
'pending',
'active',
'canceling',
'terminated'
];
const statusStrings = ['pending', 'active', 'canceling', 'terminated'];
export const pickRandomStatusString = () => random.arrayElement(statusStrings);
export default factory.extend({
id: (i) => `session-id-${i}`,
status: pickRandomStatusString,
@@ -26,7 +20,8 @@ export default factory.extend({
const scopeId = record.scopeId;
if (record.scope.type === 'project') {
const orgScopeId = record.scope?.scope.id;
const user = server.schema.users.where({ scopeId: orgScopeId }).models[0];
const user = server.schema.users.where({ scopeId: orgScopeId })
.models[0];
if (user) record.update({ user });
}
const target = server.schema.targets.where({ scopeId }).models[0];
@@ -39,7 +34,6 @@ export default factory.extend({
if (host) record.update({ host });
}
}
}
})
},
}),
});
+9 -11
View File
@@ -1,16 +1,15 @@
import factory from '../generated/factories/target';
import { trait } from 'ember-cli-mirage';
import { random } from 'faker';
import { random, datatype } from 'faker';
const randomBoolean = (chance = 0.5) => Math.random() < chance;
const hostSetChance = 0.3;
export default factory.extend({
/**
* -1 means "unlimited" and we want to generate these on occassion.
*/
session_connection_limit: () => random.arrayElement([-1, random.number()]),
session_connection_limit: () => random.arrayElement([-1, datatype.number()]),
/**
* Generates attributes fields by type.
@@ -19,8 +18,8 @@ export default factory.extend({
if (target.type === 'tcp') {
target.update({
attributes: {
default_port: random.number()
}
default_port: datatype.number(),
},
});
}
},
@@ -37,10 +36,9 @@ export default factory.extend({
// expect at this level of abstraction, but appears to be a serialized
// representation of the model instance. It's very confusing since
// the result set of `where` _is a collection of model instances_.
.where(hostSet => hostSet.scopeId === target.scope.id).models
.filter(() => randomBoolean(hostSetChance));
target.update({hostSets: randomlySelectedHostSets});
}
})
.where((hostSet) => hostSet.scopeId === target.scope.id)
.models.filter(() => randomBoolean(hostSetChance));
target.update({ hostSets: randomlySelectedHostSets });
},
}),
});
+1 -1
View File
@@ -1,5 +1,5 @@
import factory from '../generated/factories/user';
export default factory.extend({
id: (i) => `user-${i}`
id: (i) => `user-${i}`,
});
@@ -1,17 +1,15 @@
import { Factory } from 'ember-cli-mirage';
import { random, date } from 'faker';
import { random, date, datatype } from 'faker';
/**
* GeneratedAccountFactory
*/
export default Factory.extend({
type: 'password',
name: () => random.words(),
description: () => random.words(),
created_time: () => date.recent(),
updated_time: () => date.recent(),
version: () => random.number(),
version: () => datatype.number(),
attributes: () => ({ login_name: random.words() }),
});
@@ -1,16 +1,14 @@
import { Factory } from 'ember-cli-mirage';
import { random, date } from 'faker';
import { random, date, datatype } from 'faker';
/**
* GeneratedAuthMethodModelFactory
*/
export default Factory.extend({
type: 'password',
name: () => random.words(),
description: () => random.words(),
created_time: () => date.recent(),
updated_time: () => date.recent(),
disabled: () => random.boolean(),
disabled: () => datatype.boolean(),
});
@@ -1,16 +1,14 @@
import { Factory } from 'ember-cli-mirage';
import { random, date } from 'faker';
import { random, date, datatype } from 'faker';
/**
* GeneratedGroupModelFactory
* Group contains all fields related to a Group resource
*/
export default Factory.extend({
name: () => random.words(),
description: () => random.words(),
created_time: () => date.recent(),
updated_time: () => date.recent(),
disabled: () => random.boolean(),
disabled: () => datatype.boolean(),
});
@@ -1,16 +1,14 @@
import { Factory } from 'ember-cli-mirage';
import { random, date } from 'faker';
import { random, date, datatype } from 'faker';
/**
* GeneratedHostCatalogModelFactory
*/
export default Factory.extend({
type: 'static',
name: () => random.words(),
description: () => random.words(),
created_time: () => date.recent(),
updated_time: () => date.recent(),
disabled: () => random.boolean(),
disabled: () => datatype.boolean(),
});
@@ -1,17 +1,15 @@
import { Factory } from 'ember-cli-mirage';
import { random, date } from 'faker';
import { random, date, datatype } from 'faker';
/**
* GeneratedHostSetModelFactory
*/
export default Factory.extend({
type: 'static',
name: () => random.words(),
description: () => random.words(),
created_time: () => date.recent(),
updated_time: () => date.recent(),
version: () => random.number(),
size: () => random.number(),
version: () => datatype.number(),
size: () => datatype.number(),
});
@@ -1,17 +1,17 @@
import { Factory } from 'ember-cli-mirage';
import { random, date, internet } from 'faker';
import { random, date, internet, datatype } from 'faker';
/**
* GeneratedHostModelFactory
*/
export default Factory.extend({
type: 'static',
name: () => random.words(),
description: () => random.words(),
created_time: () => date.recent(),
updated_time: () => date.recent(),
version: () => random.number(),
attributes: () => { return { address: internet.ipv6() } },
version: () => datatype.number(),
attributes: () => {
return { address: internet.ipv6() };
},
});
@@ -6,10 +6,8 @@ import { random, date } from 'faker';
*
*/
export default Factory.extend({
name: () => random.words(),
description: () => random.words(),
created_time: () => date.recent(),
updated_time: () => date.recent(),
});
@@ -1,16 +1,14 @@
import { Factory } from 'ember-cli-mirage';
import { random, date } from 'faker';
import { random, date, datatype } from 'faker';
/**
* GeneratedProjectModelFactory
* Project contains all fields related to a Project resource
*/
export default Factory.extend({
name: () => random.words(),
description: () => random.words(),
created_time: () => date.recent(),
updated_time: () => date.recent(),
disabled: () => random.boolean(),
disabled: () => datatype.boolean(),
});
@@ -1,17 +1,15 @@
import { Factory } from 'ember-cli-mirage';
import { random, date } from 'faker';
import { random, date, datatype } from 'faker';
/**
* GeneratedRoleModelFactory
* Role contains all field related to a Role resource
*/
export default Factory.extend({
name: () => random.words(),
description: () => random.words(),
created_time: () => date.recent(),
updated_time: () => date.recent(),
disabled: () => random.boolean(),
version: () => random.number(),
disabled: () => datatype.boolean(),
version: () => datatype.number(),
});
@@ -1,15 +1,13 @@
import { Factory } from 'ember-cli-mirage';
import { random, date } from 'faker';
import { random, date, datatype } from 'faker';
/**
* GeneratedScopeModelFactory
*/
export default Factory.extend({
name: () => random.words(),
description: () => random.words(),
created_time: () => date.recent(),
updated_time: () => date.recent(),
disabled: () => random.boolean(),
disabled: () => datatype.boolean(),
});
@@ -1,14 +1,12 @@
import { Factory } from 'ember-cli-mirage';
import { random, date } from 'faker';
import { date, datatype } from 'faker';
/**
* GeneratedSessionModelFactory
*/
export default Factory.extend({
type: 'tcp',
created_time: () => date.recent(),
updated_time: () => date.recent(),
version: () => random.number(),
version: () => datatype.number(),
});
@@ -1,19 +1,17 @@
import { Factory } from 'ember-cli-mirage';
import { random, date } from 'faker';
import { random, date, datatype } from 'faker';
/**
* GeneratedTargetModelFactory
*/
export default Factory.extend({
type: 'tcp',
name: () => random.words(),
session_max_seconds: () => random.number(),
session_connection_limit: () => random.number(),
session_max_seconds: () => datatype.number(),
session_connection_limit: () => datatype.number(),
description: () => random.words(),
created_time: () => date.recent(),
updated_time: () => date.recent(),
disabled: () => random.boolean(),
version: () => random.number(),
disabled: () => datatype.boolean(),
version: () => datatype.number(),
});
@@ -1,16 +1,14 @@
import { Factory } from 'ember-cli-mirage';
import { random, date } from 'faker';
import { random, date, datatype } from 'faker';
/**
* GeneratedUserModelFactory
* User contains all fields related to a User resource
*/
export default Factory.extend({
name: () => random.words(),
description: () => random.words(),
created_time: () => date.recent(),
updated_time: () => date.recent(),
disabled: () => random.boolean(),
disabled: () => datatype.boolean(),
});
+1 -3
View File
@@ -1,8 +1,6 @@
import { Model, belongsTo } from 'ember-cli-mirage';
export default Model.extend({
scope: belongsTo(),
authMethod: belongsTo()
authMethod: belongsTo(),
});
+1 -3
View File
@@ -1,7 +1,5 @@
import { Model, belongsTo } from 'ember-cli-mirage';
export default Model.extend({
scope: belongsTo()
scope: belongsTo(),
});
+1 -3
View File
@@ -1,8 +1,6 @@
import { Model, belongsTo, hasMany } from 'ember-cli-mirage';
export default Model.extend({
scope: belongsTo(),
members: hasMany('user')
members: hasMany('user'),
});
+1 -3
View File
@@ -1,8 +1,6 @@
import { Model, belongsTo, hasMany } from 'ember-cli-mirage';
export default Model.extend({
scope: belongsTo(),
hostSets: hasMany()
hostSets: hasMany(),
});
+1 -3
View File
@@ -1,10 +1,8 @@
import { Model, belongsTo, hasMany } from 'ember-cli-mirage';
export default Model.extend({
scope: belongsTo(),
target: belongsTo(),
hostCatalog: belongsTo(),
hosts: hasMany()
hosts: hasMany(),
});
+1 -3
View File
@@ -1,8 +1,6 @@
import { Model, belongsTo } from 'ember-cli-mirage';
export default Model.extend({
scope: belongsTo(),
hostCatalog: belongsTo()
hostCatalog: belongsTo(),
});
+1 -3
View File
@@ -1,9 +1,7 @@
import { Model, belongsTo, hasMany } from 'ember-cli-mirage';
export default Model.extend({
scope: belongsTo(),
users: hasMany(),
groups: hasMany()
groups: hasMany(),
});
-2
View File
@@ -1,11 +1,9 @@
import { Model, belongsTo } from 'ember-cli-mirage';
export default Model.extend({
scope: belongsTo(),
user: belongsTo(),
target: belongsTo(),
host: belongsTo(),
hostSet: belongsTo(),
});
+1 -3
View File
@@ -1,8 +1,6 @@
import { Model, belongsTo, hasMany } from 'ember-cli-mirage';
export default Model.extend({
scope: belongsTo(),
hostSets: hasMany()
hostSets: hasMany(),
});
+1 -3
View File
@@ -1,8 +1,6 @@
import { Model, belongsTo, hasMany } from 'ember-cli-mirage';
export default Model.extend({
scope: belongsTo(),
accounts: hasMany('account')
accounts: hasMany('account'),
});
+91 -22
View File
@@ -12,7 +12,7 @@ import { Response } from 'miragejs';
// */
// export default function authenticateHandler(schema, request) {
// const payload = JSON.parse(request.requestBody);
// if (payload.credentials.login_name === 'error') {
// if (payload.attributes.login_name === 'error') {
// return new Response(400);
// } else {
// const cookieName = config.auth.passwordCookieName;
@@ -23,29 +23,98 @@ import { Response } from 'miragejs';
// }
// }
// Quick and dirty counter system to simulate the polling behavior
// of the API. If the OIDC flow is pending, the route returns 100.
// If complete it returns 200 with the token JSON.
let oidcAttemptCounter = 0;
const oidcRequiredAttempts = 3;
const commandHandlers = {
password: {
login: (payload, scopeAttrs) => {
if (payload.attributes.login_name === 'error') {
return new Response(400);
} else {
return new Response(
200,
{},
{
attributes: {
scope: scopeAttrs,
id: 'token123',
token: 'thetokenstring',
account_id: '1',
user_id: 'user123',
auth_method_id: 'authmethod123',
created_time: '',
updated_time: '',
last_used_time: '',
expiration_time: '',
},
}
);
}
},
},
/**
* OIDC authentication is a two-step process:
*
* 1. `authenticate:start` kicks of authentication by requesting some details
* from the Boundary server about the request, including the third-party
* URL to which to redirect the user.
* 2. `authenticate` accepts the token_id and state parameters in
* order to retrieve a Boundary token. This endpoint may be polled until
* the authentication flow is completed.
*/
oidc: {
start: () =>
new Response(
200,
{},
{
attributes: {
auth_url: 'https://www.duckduckgo.com',
token_id: 'token_1234',
},
}
),
token: (_, scopeAttrs) => {
oidcAttemptCounter++;
if (oidcAttemptCounter < oidcRequiredAttempts) {
return new Response(202);
} else {
return new Response(
200,
{},
{
attributes: {
scope: scopeAttrs,
id: 'token123',
token: 'thetokenstring',
account_id: '1',
user_id: 'user123',
auth_method_id: 'authmethod123',
created_time: '',
updated_time: '',
last_used_time: '',
expiration_time: '',
},
}
);
}
},
},
};
export function authHandler({ scopes, authMethods }, request) {
const payload = JSON.parse(request.requestBody);
if (payload.credentials.login_name === 'error') {
return new Response(400);
} else {
const id = request.params.id_method.split(':')[0];
const authMethod = authMethods.find(id);
const scope = scopes.find(authMethod.scopeId);
const scopeAttrs =
this.serialize(scopes.find(scope.id));
return new Response(200, {}, {
scope: scopeAttrs,
id: 'token123',
token: 'thetokenstring',
account_id: '1',
user_id: 'authenticateduser',
auth_method_id: 'authmethod123',
created_time: '',
updated_time: '',
last_used_time: '',
expiration_time: ''
});
}
const [, id] = request.params.id_method.match(/(?<id>.[^:]*)/);
const { command } = payload;
const authMethod = authMethods.find(id);
const scope = scopes.find(authMethod.scopeId);
const scopeAttrs = this.serialize(scopes.find(scope.id));
return commandHandlers[authMethod.type][command](payload, scopeAttrs);
}
export function deauthHandler() {
+28 -10
View File
@@ -1,23 +1,41 @@
export default function(server) {
export default function (server) {
// Scope resources
// creates a global scope
const globalScope = server.create('scope', {
id: 'global',
type: 'global',
name: 'Global'
name: 'Global',
});
const orgScope = server.createList('scope', 3, {
type: 'org',
scope: { id: globalScope.id, type: globalScope.type }
}, 'withChildren')[0];
const orgScope = server.createList(
'scope',
3,
{
type: 'org',
scope: { id: globalScope.id, type: globalScope.type },
},
'withChildren'
)[0];
server.create('user', { id: 'authenticateduser' });
// Auth
server.createList('auth-method', 1, { scope: globalScope }, 'withAccountsAndUsers');
server.createList('auth-method', 3, { scope: orgScope }, 'withAccountsAndUsers');
const globalAuthMethods = server.createList(
'auth-method',
1,
{ scope: globalScope },
'withAccountsAndUsers'
);
const orgAuthMethods = server.createList(
'auth-method',
3,
{ scope: orgScope },
'withAccountsAndUsers'
);
// Assign primary auth methods per scope
// TODO make this generic
globalScope.update({ primaryAuthMethodId: globalAuthMethods[0].id });
orgScope.update({ primaryAuthMethodId: orgAuthMethods[1].id });
// Groups and Users
server.createList('group', 1, { scope: globalScope }, 'withMembers');
@@ -27,7 +45,7 @@ export default function(server) {
server.createList('role', 5, { scope: orgScope }, 'withPrincipals');
// Other resources
server.schema.scopes.where({type: 'project'}).models.forEach(scope => {
server.schema.scopes.where({ type: 'project' }).models.forEach((scope) => {
server.createList('host-catalog', 2, { scope }, 'withChildren');
server.createList('target', 2, { scope }, 'withRandomHostSets');
server.createList('session', 4, { scope }, 'withAssociations');
+5 -6
View File
@@ -1,8 +1,8 @@
import Ember from 'ember';
import config from 'ember-get-config';
import { random } from 'faker';
import { datatype } from 'faker';
export default function initializeMockIPC (server) {
export default function initializeMockIPC(server) {
/**
* We strive to make this application runnable in a regular web browser, since
* it is a convenient environment for development and testing. But only an
@@ -51,13 +51,13 @@ export default function initializeMockIPC (server) {
target,
userId: 'authenticateduser',
type,
created_time: new Date().toISOString()
created_time: new Date().toISOString(),
});
return {
address: window.location.hostname,
port: random.number(),
port: datatype.number(),
protocol: type,
session_id: newSession.id
session_id: newSession.id,
};
}
}
@@ -80,5 +80,4 @@ export default function initializeMockIPC (server) {
}
});
}
}
+5 -2
View File
@@ -4,9 +4,12 @@ export default ApplicationSerializer.extend({
modelName: 'account',
_hashForModel(model) {
const json = ApplicationSerializer.prototype._hashForModel.apply(this, arguments);
const json = ApplicationSerializer.prototype._hashForModel.apply(
this,
arguments
);
json.auth_method_id = model.authMethodId;
delete json.attributes?.password;
return json;
}
},
});
+3 -5
View File
@@ -6,7 +6,6 @@ import { isArray } from '@ember/array';
* Manages serialization/normalization of data into and out of the mock API.
*/
export default RestSerializer.extend({
// =attributes
/**
@@ -45,7 +44,7 @@ export default RestSerializer.extend({
serialize() {
let json = RestSerializer.prototype.serialize.apply(this, arguments);
// If array, root it under a standard `items` key
if (isArray(json)) json = {items: json};
if (isArray(json)) json = { items: json };
return json;
},
@@ -59,7 +58,7 @@ export default RestSerializer.extend({
if (model.scope) {
json.scope = {
id: model.scope.id,
type: model.scope.type
type: model.scope.type,
};
}
return json;
@@ -79,6 +78,5 @@ export default RestSerializer.extend({
}
const value = RestSerializer.prototype.normalize.apply(this, [newJSON]);
return value;
}
},
});
+14 -1
View File
@@ -1,5 +1,18 @@
import ApplicationSerializer from './application';
export default ApplicationSerializer.extend({
modelName: 'auth-method'
modelName: 'auth-method',
_hashForModel(model) {
const json = ApplicationSerializer.prototype._hashForModel.apply(
this,
arguments
);
// If the scope marks this auth method as primary, designate it
// as such with a read-only boolean field (this is how the API behaves).
const isPrimary =
model.scope && model.scope.primaryAuthMethodId === model.id;
json.is_primary = isPrimary;
return json;
},
});
+5 -3
View File
@@ -11,9 +11,11 @@ export default ApplicationSerializer.extend({
},
_hashForModel(model) {
const json = ApplicationSerializer.prototype._hashForModel.apply(this, arguments);
const json = ApplicationSerializer.prototype._hashForModel.apply(
this,
arguments
);
if (model.memberIds.length) json.member_ids = model.memberIds;
return json;
}
},
});
+5 -3
View File
@@ -11,12 +11,14 @@ export default ApplicationSerializer.extend({
},
_hashForModel(model) {
const json = ApplicationSerializer.prototype._hashForModel.apply(this, arguments);
const json = ApplicationSerializer.prototype._hashForModel.apply(
this,
arguments
);
json.host_catalog_id = model.hostCatalogId;
if (model.hostIds?.length) {
json.host_ids = model.hostIds;
}
return json;
}
},
});
+1 -1
View File
@@ -1,5 +1,5 @@
import ApplicationSerializer from './application';
export default ApplicationSerializer.extend({
modelName: 'host'
modelName: 'host',
});
+10 -7
View File
@@ -4,23 +4,26 @@ export default ApplicationSerializer.extend({
modelName: 'role',
_hashForModel(model) {
const json = ApplicationSerializer.prototype._hashForModel.apply(this, arguments);
const serializedUsers = model.users.models.map(user => ({
const json = ApplicationSerializer.prototype._hashForModel.apply(
this,
arguments
);
const serializedUsers = model.users.models.map((user) => ({
scope_id: model.scope.id,
id: user.id,
type: 'user'
type: 'user',
}));
const serializedGroups = model.groups.models.map(group => ({
const serializedGroups = model.groups.models.map((group) => ({
scope_id: model.scope.id,
id: group.id,
type: 'group'
type: 'group',
}));
json.principals = [ ...serializedUsers, ...serializedGroups ];
json.principals = [...serializedUsers, ...serializedGroups];
if (!json.principals.length) delete json.principals;
// default grant scope
if (!json.grant_scope_id) json.grant_scope_id = json.scope.id;
return json;
}
},
});
+1 -1
View File
@@ -1,5 +1,5 @@
import ApplicationSerializer from './application';
export default ApplicationSerializer.extend({
modelName: 'scope'
modelName: 'scope',
});
+5 -3
View File
@@ -11,12 +11,14 @@ export default ApplicationSerializer.extend({
},
_hashForModel(model) {
const json = ApplicationSerializer.prototype._hashForModel.apply(this, arguments);
const json = ApplicationSerializer.prototype._hashForModel.apply(
this,
arguments
);
json.user_id = model.userId;
json.target_id = model.targetId;
json.host_set_id = model.hostSetId;
json.host_id = model.hostId;
return json;
}
},
});
+6 -4
View File
@@ -11,16 +11,18 @@ export default ApplicationSerializer.extend({
},
_hashForModel(model) {
const json = ApplicationSerializer.prototype._hashForModel.apply(this, arguments);
const json = ApplicationSerializer.prototype._hashForModel.apply(
this,
arguments
);
const { hostSets } = this.schema;
if (model.hostSetIds?.length) {
json.host_sets = model.hostSetIds.map(host_set_id => {
json.host_sets = model.hostSetIds.map((host_set_id) => {
const hostSet = hostSets.find(host_set_id);
const host_catalog_id = hostSet?.hostCatalog?.id;
return { id: host_set_id, host_catalog_id };
});
}
return json;
}
},
});
+5 -2
View File
@@ -11,8 +11,11 @@ export default ApplicationSerializer.extend({
},
_hashForModel(model) {
const json = ApplicationSerializer.prototype._hashForModel.apply(this, arguments);
const json = ApplicationSerializer.prototype._hashForModel.apply(
this,
arguments
);
if (model.accountIds.length) json.account_ids = model.accountIds;
return json;
}
},
});
+32 -23
View File
@@ -10,59 +10,68 @@
"scripts": {
"build:development": "ember build",
"build": "ember build --environment=production",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel 'lint:!(fix)'",
"lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
"lint:hbs": "ember-template-lint .",
"lint:hbs:fix": "ember-template-lint . --fix",
"lint:js": "eslint .",
"lint:js:fix": "eslint . --fix",
"format": "npm run format:js",
"format:js": "prettier --write '{addon,app,config,stories,tests}/**/*.js' *.js",
"format:js": "prettier --write '{addon,app,config,stories,tests,mirage}/**/*.js' *.js",
"start": "ember serve",
"test": "ember test",
"test:ember-compatibility": "ember try:each",
"doc:toc": "doctoc README.md"
},
"dependencies": {
"ember-cli-babel": "^7.21.0",
"ember-cli-htmlbars": "^5.2.0",
"ember-cli-babel": "^7.23.0",
"ember-cli-htmlbars": "^5.3.1",
"ember-cli-mirage": "^1.1.8",
"ember-data": "^3.20.0",
"ember-data-model-fragments": "5.0.0-beta.0",
"ember-fetch": "^8.0.1",
"ember-cli-mirage": "^1.1.8"
"ember-fetch": "^8.0.1"
},
"devDependencies": {
"@ember/optional-features": "^1.3.0",
"@glimmer/component": "^1.0.1",
"@glimmer/tracking": "^1.0.0",
"@ember/optional-features": "^2.0.0",
"@ember/test-helpers": "^2.1.4",
"@glimmer/component": "^1.0.3",
"@glimmer/tracking": "^1.0.3",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"doctoc": "^1.4.0",
"ember-auto-import": "^1.6.0",
"ember-cli": "~3.20.2",
"ember-auto-import": "^1.10.1",
"ember-cli": "~3.24.0",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-inject-live-reload": "^2.0.2",
"ember-cli-sri": "^2.1.1",
"ember-cli-uglify": "^3.0.0",
"ember-cli-terser": "^4.0.1",
"ember-cli-update": "^0.54.6",
"ember-copy": "^1.0.0",
"ember-disable-prototype-extensions": "^1.1.3",
"ember-export-application-global": "^2.0.1",
"ember-get-config": "^0.3.0",
"ember-load-initializers": "^2.1.1",
"ember-load-initializers": "^2.1.2",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-qunit": "^4.6.0",
"ember-resolver": "^8.0.0",
"ember-source": "~3.20.2",
"ember-source-channel-url": "^2.0.1",
"ember-template-lint": "^2.9.1",
"ember-page-title": "^6.0.3",
"ember-qunit": "^5.1.1",
"ember-resolver": "^8.0.2",
"ember-source": "~3.24.0",
"ember-source-channel-url": "^3.0.0",
"ember-template-lint": "^2.15.0",
"ember-try": "^1.4.0",
"eslint": "^7.5.0",
"eslint-plugin-ember": "^8.9.1",
"eslint": "^7.17.0",
"eslint-config-prettier": "^7.1.0",
"eslint-plugin-ember": "^10.1.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.3.1",
"loader.js": "^4.7.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.0.5",
"qunit-dom": "^1.2.0"
"prettier": "^2.2.1",
"qunit": "^2.13.0",
"qunit-dom": "^1.6.0"
},
"engines": {
"node": "10.* || >= 12"
"node": ">=10 <=15"
},
"ember": {
"edition": "octane"
@@ -1,3 +1,5 @@
{{page-title "Dummy"}}
<h2 id="title">Welcome to Ember</h2>
{{outlet}}
@@ -3,7 +3,7 @@
"packages": [
{
"name": "ember-cli",
"version": "3.20.2",
"version": "3.24.0",
"blueprints": [
{
"name": "addon",
+7
View File
@@ -21,6 +21,13 @@
{{content-for "body"}}
{{content-for "test-body"}}
<div id="qunit"></div>
<div id="qunit-fixture">
<div id="ember-testing-container">
<div id="ember-testing"></div>
</div>
</div>
<script src="/testem.js" integrity=""></script>
<script src="{{rootURL}}assets/vendor.js"></script>
<script src="{{rootURL}}assets/test-support.js"></script>
+4
View File
@@ -1,8 +1,12 @@
import Application from 'dummy/app';
import config from 'dummy/config/environment';
import * as QUnit from 'qunit';
import { setApplication } from '@ember/test-helpers';
import { setup } from 'qunit-dom';
import { start } from 'ember-qunit';
setApplication(Application.create(config.APP));
setup(QUnit.assert);
start();
@@ -9,7 +9,7 @@ module('Unit | Mixin | build-url', function (hooks) {
test('it does not interfere with basic URLs', function (assert) {
assert.expect(1);
/* eslint-disable-next-line ember/no-new-mixins */
/* eslint-disable-next-line ember/no-new-mixins, ember/no-classic-classes */
const Adapter = RESTAdapter.extend(AdapterBuildURLMixin);
this.owner.register('adapter:adapter', Adapter);
const adapter = this.owner.lookup('adapter:adapter');
@@ -19,7 +19,7 @@ module('Unit | Mixin | build-url', function (hooks) {
test('it does not interfere with namespaced URLs', function (assert) {
assert.expect(1);
/* eslint-disable-next-line ember/no-new-mixins */
/* eslint-disable-next-line ember/no-new-mixins, ember/no-classic-classes */
const Adapter = RESTAdapter.extend(AdapterBuildURLMixin, {
namespace: 'api/v1',
});
@@ -31,7 +31,7 @@ module('Unit | Mixin | build-url', function (hooks) {
test('it can prepend a prefix', function (assert) {
assert.expect(1);
/* eslint-disable-next-line ember/no-new-mixins */
/* eslint-disable-next-line ember/no-new-mixins, ember/no-classic-classes */
const Adapter = RESTAdapter.extend(AdapterBuildURLMixin, {
urlPrefix() {
return '/foo/bars';
@@ -45,7 +45,7 @@ module('Unit | Mixin | build-url', function (hooks) {
test('it can append a suffix', function (assert) {
assert.expect(1);
/* eslint-disable-next-line ember/no-new-mixins */
/* eslint-disable-next-line ember/no-new-mixins, ember/no-classic-classes */
const Adapter = RESTAdapter.extend(AdapterBuildURLMixin, {
urlSuffix() {
return ':method';
@@ -21,5 +21,4 @@ module('Unit | Model | account', function (hooks) {
model.attributes.login_name = 'username';
assert.equal(model.username, 'username');
});
});
@@ -1,11 +1,11 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Model | auth token', function(hooks) {
module('Unit | Model | auth token', function (hooks) {
setupTest(hooks);
// Replace this with your real tests.
test('it exists', function(assert) {
test('it exists', function (assert) {
let store = this.owner.lookup('service:store');
let model = store.createRecord('auth-token', {});
assert.ok(model);
+4 -16
View File
@@ -24,10 +24,7 @@ module('Unit | Model | host set', function (hooks) {
attributes: {
name: 'Host Set',
description: 'Description',
host_ids: [
{value: '1'},
{value: '3'},
],
host_ids: [{ value: '1' }, { value: '3' }],
version: 1,
scope: {
scope_id: 'o_1',
@@ -58,10 +55,7 @@ module('Unit | Model | host set', function (hooks) {
attributes: {
name: 'Host Set',
description: 'Description',
host_ids: [
{value: '1'},
{value: '3'},
],
host_ids: [{ value: '1' }, { value: '3' }],
version: 1,
scope: {
scope_id: 'o_1',
@@ -92,10 +86,7 @@ module('Unit | Model | host set', function (hooks) {
attributes: {
name: 'Host Set',
description: 'Description',
host_ids: [
{value: '1'},
{value: '3'},
],
host_ids: [{ value: '1' }, { value: '3' }],
version: 1,
scope: {
scope_id: 'o_1',
@@ -126,10 +117,7 @@ module('Unit | Model | host set', function (hooks) {
attributes: {
name: 'Host Set',
description: 'Description',
host_ids: [
{value: '1'},
{value: '3'},
],
host_ids: [{ value: '1' }, { value: '3' }],
version: 1,
scope: {
scope_id: 'o_1',
+9 -9
View File
@@ -1,28 +1,28 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Model | session', function(hooks) {
module('Unit | Model | session', function (hooks) {
setupTest(hooks);
test('it exists', function(assert) {
test('it exists', function (assert) {
let store = this.owner.lookup('service:store');
let model = store.createRecord('session', {});
assert.ok(model);
assert.notOk(model.isCancelable);
});
test('it allows cancellation of an active session', function(assert) {
test('it allows cancellation of an active session', function (assert) {
let store = this.owner.lookup('service:store');
let model = store.createRecord('session', {
status: 'active'
status: 'active',
});
assert.ok(model.isCancelable);
});
test('it allows cancellation of a pending session', function(assert) {
test('it allows cancellation of a pending session', function (assert) {
let store = this.owner.lookup('service:store');
let model = store.createRecord('session', {
status: 'pending'
status: 'pending',
});
assert.ok(model.isCancelable);
});
@@ -31,7 +31,7 @@ module('Unit | Model | session', function(hooks) {
assert.expect(2);
let store = this.owner.lookup('service:store');
let model = store.createRecord('session', {
status: 'pending'
status: 'pending',
});
assert.notOk(model.isActive);
model.status = 'active';
@@ -42,7 +42,7 @@ module('Unit | Model | session', function(hooks) {
assert.expect(2);
let store = this.owner.lookup('service:store');
let model = store.createRecord('session', {
status: 'active'
status: 'active',
});
assert.notOk(model.isPending);
model.status = 'pending';
@@ -55,7 +55,7 @@ module('Unit | Model | session', function(hooks) {
assert.equal(model.proxy, null);
model.setProperties({
proxy_address: 'localhost',
proxy_port: '12345'
proxy_port: '12345',
});
assert.equal(model.proxy, 'localhost:12345');
});
+14 -10
View File
@@ -186,33 +186,37 @@ module('Unit | Model | target', function (hooks) {
store.push({
data: {
id: '123abc',
type: 'target'
}
type: 'target',
},
});
const target = store.peekRecord('target', '123abc');
assert.equal( target.sessions.length, 0);
assert.equal(target.sessions.length, 0);
store.push({
data: {
id: '1',
type: 'session',
attributes: { target_id: '123abc' }
}
attributes: { target_id: '123abc' },
},
});
store.push({
data: {
id: '2',
type: 'session',
attributes: { target_id: '123abc' }
}
attributes: { target_id: '123abc' },
},
});
store.push({
data: {
id: '3',
type: 'session',
attributes: { target_id: '456xyz' }
}
attributes: { target_id: '456xyz' },
},
});
assert.equal(store.peekAll('session').length, 3, 'There are 3 sessions loaded in the store');
assert.equal(
store.peekAll('session').length,
3,
'There are 3 sessions loaded in the store'
);
assert.equal(
target.sessions.length,
2,
@@ -66,7 +66,7 @@ module('Unit | Serializer | application', function (hooks) {
const serializedRecord = serializer.serialize(snapshot);
assert.deepEqual(serializedRecord, {
name: 'User',
description: 'Description'
description: 'Description',
});
});
@@ -172,7 +172,7 @@ module('Unit | Serializer | application', function (hooks) {
attributes: {
name: 'User 1',
account_ids: [],
scope: { scope_id: 'o_123' }
scope: { scope_id: 'o_123' },
},
relationships: {},
},
@@ -0,0 +1,66 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Serializer | auth method', function (hooks) {
setupTest(hooks);
// Replace this with your real tests.
test('it exists', function (assert) {
let store = this.owner.lookup('service:store');
let serializer = store.serializerFor('auth-method');
assert.ok(serializer);
});
test('it serializes records', function (assert) {
let store = this.owner.lookup('service:store');
let record = store.createRecord('auth-method', {});
let serializedRecord = record.serialize();
assert.ok(serializedRecord);
});
test('it sorts primary first in normalizeArrayResponse', function (assert) {
assert.expect(2);
const store = this.owner.lookup('service:store');
const serializer = store.serializerFor('auth-method');
const modelClass = store.createRecord('auth-method').constructor;
const payload = {
items: [{ id: 1 }, { id: 2, is_primary: true }, { id: 3 }],
};
const normalizedArray = serializer.normalizeArrayResponse(
store,
modelClass,
payload
);
assert.ok(payload.items[1].is_primary, 'Second payload item is primary');
assert.deepEqual(
normalizedArray,
{
included: [],
data: [
{
id: '2',
type: 'auth-method',
attributes: { is_primary: true },
relationships: {},
},
{
id: '1',
type: 'auth-method',
attributes: { is_primary: false },
relationships: {},
},
{
id: '3',
type: 'auth-method',
attributes: { is_primary: false },
relationships: {},
},
],
},
'First normalized item is primary'
);
});
});
@@ -1,18 +1,18 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Serializer | host', function(hooks) {
module('Unit | Serializer | host', function (hooks) {
setupTest(hooks);
// Replace this with your real tests.
test('it exists', function(assert) {
test('it exists', function (assert) {
let store = this.owner.lookup('service:store');
let serializer = store.serializerFor('host');
assert.ok(serializer);
});
test('it serializes records', function(assert) {
test('it serializes records', function (assert) {
let store = this.owner.lookup('service:store');
let record = store.createRecord('host', {});
@@ -21,7 +21,7 @@ module('Unit | Serializer | role', function (hooks) {
name: 'User',
description: 'Description',
version: 1,
grant_scope_id: null
grant_scope_id: null,
});
});
@@ -1,11 +1,11 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Serializer | session', function(hooks) {
module('Unit | Serializer | session', function (hooks) {
setupTest(hooks);
// Replace this with your real tests.
test('it exists', function(assert) {
test('it exists', function (assert) {
let store = this.owner.lookup('service:store');
let serializer = store.serializerFor('session');
@@ -20,7 +20,7 @@ module('Unit | Serializer | target', function (hooks) {
type: 'org',
},
version: 1,
type: 'tcp'
type: 'tcp',
});
const snapshot = record._createSnapshot();
snapshot.adapterOptions = {};
Loaded 100 of 562 files, more files were not shown because too many files have changed in this diff. Show more