Browse Source

Fix CRAN tests

tags/v0.3.1
boB Rudis 7 years ago
parent
commit
ca3e87571f
No known key found for this signature in database GPG Key ID: 2A514A4997464560
  1. 1
      .Rbuildignore
  2. 8
      DESCRIPTION
  3. 6
      NAMESPACE
  4. 37
      R/dkim.r
  5. 5
      R/gdns-package.r
  6. 2
      R/spf.r
  7. 16
      cran-comments.md
  8. 14
      gdns.Rproj
  9. 1
      man/bulk_query.Rd
  10. 1
      man/gdns.Rd
  11. 1
      man/has_spf.Rd
  12. 3
      man/is_soft_fail.Rd
  13. 1
      man/query.Rd
  14. 5
      man/spf_ipv4s.Rd
  15. 3
      man/split_spf.Rd

1
.Rbuildignore

@ -6,3 +6,4 @@
^CONDUCT\.md$ ^CONDUCT\.md$
^README\.Rmd$ ^README\.Rmd$
^cran-comments\.md$ ^cran-comments\.md$
^docs$

8
DESCRIPTION

@ -1,6 +1,6 @@
Package: gdns Package: gdns
Title: Tools to Work with Google DNS Over HTTPS API Title: Tools to Work with Google DNS Over HTTPS API
Version: 0.2.0 Version: 0.2.1
Authors@R: c(person("Bob", "Rudis", email = "bob@rud.is", role = c("aut", "cre"))) Authors@R: c(person("Bob", "Rudis", email = "bob@rud.is", role = c("aut", "cre")))
Maintainer: Bob Rudis <bob@rud.is> Maintainer: Bob Rudis <bob@rud.is>
Description: To address the problem of insecurity of UDP-based DNS requests, Description: To address the problem of insecurity of UDP-based DNS requests,
@ -23,5 +23,7 @@ Imports:
httr, httr,
jsonlite, jsonlite,
purrr, purrr,
stringi stringi,
RoxygenNote: 5.0.1 tibble,
dplyr
RoxygenNote: 6.0.1

6
NAMESPACE

@ -13,13 +13,19 @@ export(spf_ipv6s)
export(spf_ptrs) export(spf_ptrs)
export(split_spf) export(split_spf)
import(httr) import(httr)
importFrom(dplyr,as_data_frame)
importFrom(dplyr,bind_cols)
importFrom(dplyr,bind_rows)
importFrom(jsonlite,fromJSON) importFrom(jsonlite,fromJSON)
importFrom(purrr,"%>%")
importFrom(purrr,"%||%") importFrom(purrr,"%||%")
importFrom(purrr,map) importFrom(purrr,map)
importFrom(purrr,map_df) importFrom(purrr,map_df)
importFrom(purrr,safely) importFrom(purrr,safely)
importFrom(stringi,stri_detect_fixed)
importFrom(stringi,stri_enc_toutf8) importFrom(stringi,stri_enc_toutf8)
importFrom(stringi,stri_replace_all_regex) importFrom(stringi,stri_replace_all_regex)
importFrom(stringi,stri_split_fixed) importFrom(stringi,stri_split_fixed)
importFrom(stringi,stri_split_regex) importFrom(stringi,stri_split_regex)
importFrom(stringi,stri_trim) importFrom(stringi,stri_trim)
importFrom(tibble,data_frame)

37
R/dkim.r

@ -0,0 +1,37 @@
#' #' Split out all SPF records in a domain's TXT record
#' #'
#' #' Given a vector of TXT records, this function will return a list of vectors
#' #' of all the SPF records for each. If the given TXT record is not an SPF
#' #' record, \code{NA} is returned (which makes it easy to skip with \code{purrr}
#' #' functions).
#' #'
#' #' @param dkim_rec a character vector of DNS TXT records
#' #' @export
#' parse_dkim <- function(dkim_rec) {
#' purrr::map_df(dkim_rec, .parse_dkim)
#' }
#'
#' .parse_dkim <- function(dkim_rec) {
#'
#' if (has_dkim(dkim_rec)) {
#' spf_rec <- stringi::stri_trim(stringi::stri_replace_all_regex(dkim_rec, '"', ""))
#' recs <- stri_trim(unlist(stringi::stri_split_regex(dkim_rec, ";")))
#' recs <- grep("v=DKIM1", recs, invert=TRUE, value=TRUE)
#' purrr::keep(recs, stringi::stri_detect_fixed, "=") %>%
#' purrr::map_df(~{
#' x <- stringi::stri_match_all_regex(.x, "(.*)=(.*)")[[1]]
#' data_frame(key=x[,2], value=x[,3])
#' })
#' } else {
#' NULL
#' }
#'
#' }
#'
#' #' Test for whether a DNS TXT record is a DKIM record
#' #'
#' #' @param spf_rec a character vector of DNS TXT records
#' #' @export
#' has_dkim <- function(dkim_rec) {
#' grepl("v=DKIM1", dkim_rec)
#' }

5
R/gdns-package.r

@ -23,6 +23,9 @@
#' @import httr #' @import httr
#' @importFrom stringi stri_split_fixed stri_split_regex stri_trim #' @importFrom stringi stri_split_fixed stri_split_regex stri_trim
#' stri_replace_all_regex stri_enc_toutf8 #' stri_replace_all_regex stri_enc_toutf8
#' stri_detect_fixed
#' @importFrom jsonlite fromJSON #' @importFrom jsonlite fromJSON
#' @importFrom purrr safely map map_df %||% #' @importFrom tibble data_frame
#' @importFrom purrr safely map map_df %||% %>%
#' @importFrom dplyr bind_rows bind_cols as_data_frame
NULL NULL

2
R/spf.r

@ -2,7 +2,7 @@
#' #'
#' Given a vector of TXT records, this function will return a list of vectors #' Given a vector of TXT records, this function will return a list of vectors
#' of all the SPF records for each. If the given TXT record is not an SPF #' of all the SPF records for each. If the given TXT record is not an SPF
#' record, \code{NULL} is returned (which makes it easy to skip with \code{purrr} #' record, \code{NA} is returned (which makes it easy to skip with \code{purrr}
#' functions). #' functions).
#' #'
#' @param spf_rec a character vector of DNS TXT records #' @param spf_rec a character vector of DNS TXT records

16
cran-comments.md

@ -1,19 +1,17 @@
## Test environments ## Test environments
* local OS X install, R 3.3.1 * local OS X install, R 3.4.0
* Travis OS X (R 3.3.1 and oldrel) * ubuntu 12.04 (on travis-ci), R 3.4.0 & oldrel
* ubuntu 12.04 (on travis-ci), R 3.3.1 & oldrel * win-builder (devel and release)
* win-builder (devel and release) (caught it today just before the crash)
## R CMD check results ## R CMD check results
0 errors | 0 warnings | 1 note (new pkg) 0 errors | 0 warnings | 1 note (maintainer & acronyms)
* This is a new release.
## Reverse dependencies ## Reverse dependencies
This is a new release, so there are no reverse dependencies. None
--- ---
Added URL ref in DESCRIPTION per note from Kurt (#ty!) * This is an update release to fix CRAN checks due to the crazy way purrr does dplyr ops. This pkg now Imports the necessary dplyr functions.
* Mis-spelled words aren't mis-spelled. Too many necessary acronyms to use "'" pairs.

14
gdns.Rproj

@ -5,21 +5,19 @@ SaveWorkspace: No
AlwaysSaveHistory: Default AlwaysSaveHistory: Default
EnableCodeIndexing: Yes EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8 Encoding: UTF-8
RnwWeave: Sweave
LaTeX: pdfLaTeX
AutoAppendNewline: Yes AutoAppendNewline: Yes
StripTrailingWhitespace: Yes StripTrailingWhitespace: Yes
BuildType: Package BuildType: Package
PackageUseDevtools: Yes PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source PackageInstallArgs: --no-multiarch --with-keep.source
PackageRoxygenize: rd,collate,namespace
UseSpacesForTab: Yes
NumSpacesForTab: 2
RnwWeave: Sweave
LaTeX: pdfLaTeX
PackageBuildArgs: --resave-data PackageBuildArgs: --resave-data
PackageCheckArgs: --as-cran PackageCheckArgs: --as-cran
PackageRoxygenize: rd,collate,namespace

1
man/bulk_query.Rd

@ -41,4 +41,3 @@ gdns::bulk_query(hosts)
\references{ \references{
\url{https://developers.google.com/speed/public-dns/docs/dns-over-https} \url{https://developers.google.com/speed/public-dns/docs/dns-over-https}
} }

1
man/gdns.Rd

@ -26,4 +26,3 @@ for more information.
\author{ \author{
Bob Rudis (bob@rud.is) Bob Rudis (bob@rud.is)
} }

1
man/has_spf.Rd

@ -12,4 +12,3 @@ has_spf(spf_rec)
\description{ \description{
Test for whether a DNS TXT record is an SPF record Test for whether a DNS TXT record is an SPF record
} }

3
man/is_soft_fail.Rd

@ -1,8 +1,8 @@
% Generated by roxygen2: do not edit by hand % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/spf.r % Please edit documentation in R/spf.r
\name{is_soft_fail} \name{is_soft_fail}
\alias{is_hard_fail}
\alias{is_soft_fail} \alias{is_soft_fail}
\alias{is_hard_fail}
\alias{passes_all} \alias{passes_all}
\title{SPF "all" type test} \title{SPF "all" type test}
\usage{ \usage{
@ -18,4 +18,3 @@ passes_all(spf_rec)
\description{ \description{
SPF "all" type test SPF "all" type test
} }

1
man/query.Rd

@ -60,4 +60,3 @@ query("17.142.160.59", "PTR")
\references{ \references{
\url{https://developers.google.com/speed/public-dns/docs/dns-over-https} \url{https://developers.google.com/speed/public-dns/docs/dns-over-https}
} }

5
man/spf_ipv4s.Rd

@ -1,11 +1,11 @@
% Generated by roxygen2: do not edit by hand % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/spf.r % Please edit documentation in R/spf.r
\name{spf_ipv4s} \name{spf_ipv4s}
\alias{spf_exists}
\alias{spf_includes}
\alias{spf_ipv4s} \alias{spf_ipv4s}
\alias{spf_ipv6s} \alias{spf_ipv6s}
\alias{spf_includes}
\alias{spf_ptrs} \alias{spf_ptrs}
\alias{spf_exists}
\title{SPF field extraction functions} \title{SPF field extraction functions}
\usage{ \usage{
spf_ipv4s(spf_rec) spf_ipv4s(spf_rec)
@ -24,4 +24,3 @@ spf_exists(spf_rec)
\description{ \description{
Various helper functions to extract SPF record components. Various helper functions to extract SPF record components.
} }

3
man/split_spf.Rd

@ -12,7 +12,6 @@ split_spf(spf_rec)
\description{ \description{
Given a vector of TXT records, this function will return a list of vectors Given a vector of TXT records, this function will return a list of vectors
of all the SPF records for each. If the given TXT record is not an SPF of all the SPF records for each. If the given TXT record is not an SPF
record, \code{NULL} is returned (which makes it easy to skip with \code{purrr} record, \code{NA} is returned (which makes it easy to skip with \code{purrr}
functions). functions).
} }

Loading…
Cancel
Save