151 Commits

Author SHA1 Message Date
Benaiah Mischenko
0a5ec972db Add cachebuster to git-gateway API calls 2017-10-10 12:48:25 -07:00
Caleb
2324f08d69 Rename setUser to restoreUser. 2017-10-09 12:04:05 -06:00
Caleb
e69c8dd3fc Fix broken login when backend changed in config.
If the backend was changed in the config, the user from the old backend
would be passed to the new backend, which could cause errors if the
format was different.
2017-10-09 12:04:05 -06:00
Caleb
53e5dfee7c Check user permissions and metadata every CMS load.
Before, if the CMS was loading user OAuth credentials from
`localStorage`, then user write access would not be checked again.
However, the `config.yml` repo could be changed, which would cause the
user to be still logged in even if they did not have write permissions.
Also, if the user had updated their metadata (avatar, etc.), the CMS
would not update that either.
2017-10-09 12:04:05 -06:00
Caleb
72492749d9 Move slug sanitizer to a seperate function. 2017-10-03 13:03:28 -06:00
Caleb
9bc65cd0ac Re-implement standard slugification with IRIs instead of URIs. 2017-10-03 13:03:26 -06:00
Caleb
8a2b4fc843 Sanitize entire slug instead of just parts. 2017-10-03 13:03:26 -06:00
Caleb
d895112f9d Replace spaces in slugs/filenames with dashes. 2017-10-03 13:03:25 -06:00
Caleb
d21de7e82e Remove periods from filenames/slugs. 2017-10-03 13:03:25 -06:00
Caleb
51b89cc84b Switch from slug to sanitize-filename. 2017-10-03 13:03:22 -06:00
Shawn Erquhart
1fa949395f Add branch selection support for git gateway (#618) 2017-09-18 14:56:49 -07:00
Shawn Erquhart
d349c3d3b1 Merge pull request #590 from netlify/update-depreciated-deps
Upgrade Depreciated React Dependencies
2017-09-15 16:18:24 -04:00
Benaiah Mischenko
9f4951fcf2 Fix entry deletion on non-master branches 2017-09-14 17:32:18 -07:00
Caleb
654f844b86 Upgrade to seperate React prop-types library.
`propTypes` was seperated/depreciated from React as of 15.5.0:
https://facebook.github.io/react/blog/2017/04/07/react-v15.5.0.html#migrating-from-react.proptypes
2017-09-09 20:16:19 -06:00
Caleb
df3d8754c8 Show user avatar for git-gateway backend as well. 2017-09-08 09:02:48 -06:00
Shawn Erquhart
cd6162c3d2 git gateway implementation tweaks 2017-09-06 18:28:20 -07:00
Mathias Biilmann Christensen
bea470518e Make sure we always set a name on commits 2017-09-06 18:14:59 -07:00
Mathias Biilmann Christensen
2e4dfb33b6 Add explicit sign in button for netlify identity 2017-09-06 17:58:32 -07:00
Mathias Biilmann Christensen
aaa9d2ab95 Make Neltify CMS work with Netlify Identity Widget
When Netlify CMS uses the git-gateway backend, it will check for a

  window.netlifyIdentity

object and use that to handle the whole auth flow.

This also sets defaults for the git-gateway endpoint, that means it
can be used in templates with zero configuration and fit with a
one-click deploy to Netlify approach.

Netlify Identity itself is based on our open-source GoTrue microservice,
and Netlify's Git Gateway project is completely open-source as well.

The git-gateway backend will work with Netlify without any setup, but can
also be configured to work with any selfhosted GoTrue and Git Gateway
instances.
2017-09-06 13:52:11 -07:00
Mathias Biilmann Christensen
36f2596a9e Use netlify identity widget for auth if present 2017-09-06 13:50:02 -07:00
Shawn Erquhart
128588fd69 auth and asset setup tweaks 2017-09-06 09:35:31 -07:00
Mathias Biilmann Christensen
0b793cbc65 Fix reference to window.identity 2017-09-05 19:30:03 -07:00
Mathias Biilmann Christensen
1a25b2c6b3 Better handling of roles and names 2017-09-05 16:48:51 -07:00
Mathias Biilmann Christensen
a6b1b3f0a7 Fix open tag in auth page 2017-09-05 14:15:40 -07:00
Mathias Biilmann Christensen
bba34e5979 Use identity widget for auth if present 2017-09-05 14:07:56 -07:00
Mathias Biilmann Christensen
890ee3d7e3 Update old netlify-auth-js to gotrue-js 2017-09-05 13:24:16 -07:00
Mathias Biilmann Christensen
30aa880ed2 Make sure there's a form so enter logs in for netlify auth 2017-09-04 23:24:57 -07:00
Shawn Erquhart
0dd173a83f rename isCollaborator to hasWriteAccess 2017-08-20 16:02:57 -04:00
Caleb
6df35a2f30 Fix denied login for users with many repos.
`isCollaborator` was created in #491 to block login if a user did not have write (push) permissions to a repo, by going through the list of a users repos until it found the right one. It did not institute pagination, however, so if a user had enough repos that the one in question was on another page, the CMS would assume that they did not have permission and block the login.

This commit fixes the problem by calling the API for the specific repo instead of getting the whole list.
2017-08-19 18:07:09 -06:00
Caleb
37f6e7bac5 Fix deletion for the test-repo backend.
Deletion was added in #485, but the function for the `test-repo` backend
was `deleteEntry` instead of `deleteFile` like it was supposed to be.

Also, setting the key for a deleted file to `undefined` did not really
remove that file from the object, so there were then errors stating
`file.content` is not defined. `delete`ing the "file" from the object
fixes this bug.
2017-08-17 13:25:54 -06:00
Benaiah Mischenko
b3b13d311c Make GitHub repo name comparison case-insensitive (fixes #510) 2017-08-11 12:19:01 -07:00
tortilaman
6805a6936d Prevent unauthorized CMS access (#323) and enable use of GitHub Enterprise (#491)
* Prevent unauthorized CMS access and enable use of GitHub Enterprise
2017-08-01 20:28:03 -07:00
Benaiah Mischenko
dac57c60a0 Entry deletion for the simple workflow (#485) 2017-07-21 23:40:33 -07:00
Eamonn Bell
e51071abf4 Change .find() predicate to not reject field names based on spurious whitespace. 2017-06-22 21:49:31 +01:00
Eamonn Bell
3e105b3089 Fix indentation. 2017-06-22 21:39:32 +01:00
Eamonn Bell
a4e324201d Refactor indentifer field find and validation. 2017-06-22 21:25:30 +01:00
Eamonn Bell
eaa43488e5 Remove case sensitivity of names of fields used in slug construction 2017-06-22 14:05:22 +01:00
Mathias Biilmann
546ca5917e Add cache buster to all GitHub API calls (#449)
This should solve issues like #308 and the issues with cached
API responses after deleting an entry
2017-06-12 13:01:53 -07:00
Shawn Erquhart
e36e1880d0 print file parsing errors to console 2017-06-07 16:42:27 -04:00
Shawn Erquhart
f3cb44cb10 Merge pull request #411 from vencax/3rdpartyoauth
auth without netlify oauth provider
2017-06-05 11:24:16 -04:00
Shawn Erquhart
e3b78452fa allow test repo to be used without window.testRepo
For example purposes, its helpful to allow users to run the test
backend without creating a repo object with nested objects for
each folder. This fix creates empty objects wherever needed.
2017-06-01 15:44:20 -04:00
Luis Correia
7e7642c5ce #407 Move filtering into separate collection method 2017-05-25 15:34:57 -07:00
Luis Correia
544cb786ee #407 Add collection filtering by field and value 2017-05-25 15:34:57 -07:00
Vaclav Klecanda
018616dc68 slug from unicode chars 2017-05-09 11:18:28 -07:00
Vaclav Klecanda
26d402149a auth without netlify oauth provider 2017-05-07 06:38:33 +02:00
Joseph Earl
bfe46a8e13 Fixes #324 Use branch name from config when creating PR 2017-05-01 08:17:46 -07:00
Kevin McCormack
39852e9982 Fix filtering by file extension 2017-04-19 11:45:07 -04:00
Benaiah Mischenko
3be734da05 Merge pull request #370 from josephearl/filter-files-extension
Fixes #278 Filter folder collection files by extension
2017-04-18 16:28:05 -07:00
Joseph Earl
265146e2d1 Fixes #278 filter files by extension 2017-04-18 22:59:30 +01:00
Kevin McCormack
76bf16d62e Add backend config for site ID
Users can now specify `site_domain` in `config.yml`. This is useful
when attempting to access the CMS from a different host.
2017-04-18 16:24:45 -04:00