pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

ruby-sanitize: Import ruby-sanitize-2.1.1 as wip/ruby-sanitize



Module Name:	pkgsrc-wip
Committed By:	Atsushi Toyokura <asteria.at%gmail.com@localhost>
Pushed By:	steleto
Date:		Mon Dec 23 23:23:48 2019 +0900
Changeset:	0f8c09c4f00dccd511fa00322dfe864d39fe9d80

Modified Files:
	Makefile
Added Files:
	ruby-sanitize/DESCR
	ruby-sanitize/Makefile
	ruby-sanitize/PLIST
	ruby-sanitize/distinfo

Log Message:
ruby-sanitize: Import ruby-sanitize-2.1.1 as wip/ruby-sanitize

Sanitize is a whitelist-based HTML and CSS sanitizer. Given a list of
acceptable elements, attributes, and CSS properties, Sanitize will
remove all unacceptable HTML and/or CSS from a string.

Using a simple configuration syntax, you can tell Sanitize to allow
certain HTML elements, certain attributes within those elements, and
even certain URL protocols within attributes that contain URLs. You
can also whitelist CSS properties, @ rules, and URL protocols you wish
to allow in elements or attributes containing CSS. Any HTML or CSS
that you don't explicitly allow will be removed.

Sanitize is based on Google's Gumbo HTML5 parser, which parses HTML
exactly the same way modern browsers do, and Crass, which parses CSS
exactly the same way modern browsers do. As long as your whitelist
config only allows safe markup and CSS, even the most malformed or
malicious input will be transformed into safe output.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=0f8c09c4f00dccd511fa00322dfe864d39fe9d80

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile               |  1 +
 ruby-sanitize/DESCR    | 16 ++++++++++++++++
 ruby-sanitize/Makefile | 14 ++++++++++++++
 ruby-sanitize/PLIST    | 18 ++++++++++++++++++
 ruby-sanitize/distinfo |  6 ++++++
 5 files changed, 55 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index 2bf2f245c2..62cc51c761 100644
--- a/Makefile
+++ b/Makefile
@@ -4353,6 +4353,7 @@ SUBDIR+=	ruby-review
 SUBDIR+=	ruby-rinku
 SUBDIR+=	ruby-roo-xls
 SUBDIR+=	ruby-rouge
+SUBDIR+=	ruby-sanitize
 SUBDIR+=	ruby-simple-navigation
 SUBDIR+=	ruby-sinatra-simple-navigation
 SUBDIR+=	ruby-taskwarrior-web
diff --git a/ruby-sanitize/DESCR b/ruby-sanitize/DESCR
new file mode 100644
index 0000000000..968fd8d1ef
--- /dev/null
+++ b/ruby-sanitize/DESCR
@@ -0,0 +1,16 @@
+Sanitize is a whitelist-based HTML and CSS sanitizer. Given a list of
+acceptable elements, attributes, and CSS properties, Sanitize will
+remove all unacceptable HTML and/or CSS from a string.
+
+Using a simple configuration syntax, you can tell Sanitize to allow
+certain HTML elements, certain attributes within those elements, and
+even certain URL protocols within attributes that contain URLs. You
+can also whitelist CSS properties, @ rules, and URL protocols you wish
+to allow in elements or attributes containing CSS. Any HTML or CSS
+that you don't explicitly allow will be removed.
+
+Sanitize is based on Google's Gumbo HTML5 parser, which parses HTML
+exactly the same way modern browsers do, and Crass, which parses CSS
+exactly the same way modern browsers do. As long as your whitelist
+config only allows safe markup and CSS, even the most malformed or
+malicious input will be transformed into safe output.
diff --git a/ruby-sanitize/Makefile b/ruby-sanitize/Makefile
new file mode 100644
index 0000000000..1f4989c611
--- /dev/null
+++ b/ruby-sanitize/Makefile
@@ -0,0 +1,14 @@
+# $NetBSD$
+
+DISTNAME=	sanitize-2.1.1
+CATEGORIES=	textproc
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://github.com/rgrove/sanitize
+COMMENT=	Ruby HTML and CSS sanitizer
+LICENSE=	mit
+
+DEPENDS+=	${RUBY_PKGPREFIX}-nokogiri>=1.4.4:../../textproc/ruby-nokogiri
+
+.include "../../lang/ruby/gem.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/ruby-sanitize/PLIST b/ruby-sanitize/PLIST
new file mode 100644
index 0000000000..58bf835fc6
--- /dev/null
+++ b/ruby-sanitize/PLIST
@@ -0,0 +1,18 @@
+@comment $NetBSD$
+${GEM_HOME}/cache/${GEM_NAME}.gem
+${GEM_LIBDIR}/HISTORY.md
+${GEM_LIBDIR}/LICENSE
+${GEM_LIBDIR}/README.md
+${GEM_LIBDIR}/lib/sanitize.rb
+${GEM_LIBDIR}/lib/sanitize/config.rb
+${GEM_LIBDIR}/lib/sanitize/config/basic.rb
+${GEM_LIBDIR}/lib/sanitize/config/relaxed.rb
+${GEM_LIBDIR}/lib/sanitize/config/restricted.rb
+${GEM_LIBDIR}/lib/sanitize/transformers/clean_cdata.rb
+${GEM_LIBDIR}/lib/sanitize/transformers/clean_comment.rb
+${GEM_LIBDIR}/lib/sanitize/transformers/clean_element.rb
+${GEM_LIBDIR}/lib/sanitize/version.rb
+${GEM_LIBDIR}/test/test_sanitize.rb
+${GEM_HOME}/specifications/${GEM_NAME}.gemspec
+@pkgdir lib/ruby/gems/2.6.0/extensions
+@pkgdir lib/ruby/gems/2.6.0/build_info
diff --git a/ruby-sanitize/distinfo b/ruby-sanitize/distinfo
new file mode 100644
index 0000000000..97f931c8c7
--- /dev/null
+++ b/ruby-sanitize/distinfo
@@ -0,0 +1,6 @@
+$NetBSD$
+
+SHA1 (sanitize-2.1.1.gem) = 8a4b56b6d06a52da3fa389a0e1c20ff9ad487a2b
+RMD160 (sanitize-2.1.1.gem) = f9c4e226e1cac3681a86a1af763c155e02c92a7d
+SHA512 (sanitize-2.1.1.gem) = 1fdab0c67d5668b6a1a978ad649a91f3af66797b5fe3282d80535962a66c23ec56a4520b46e2f6793cac55785b17e5ee9f60616cd5e613f8f986abc6fe5ff71f
+Size (sanitize-2.1.1.gem) = 22528 bytes


Home | Main Index | Thread Index | Old Index