如何允许组中的所有成员在AWS IAM中承担角色?
我尝试使用以下语句,但在AWS IAM Principal Element中指定,组不能是Principal.
我希望实现如下所示:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::***:group/developer"
},
"Action": "sts:AssumeRole"
}
]
}
Run Code Online (Sandbox Code Playgroud)
这个想法是该小组的所有成员都group/developer
应该能够担任这个角色.目标是我不必单独指定一个组中的每个成员.
有没有办法实现这个目标?
在我的应用程序中,我按如下方式注册facebook-strategie:但返回的配置文件不包含电子邮件字段....
passport.use(new FacebookStrategy({
clientID: config.facebook.clientID,
clientSecret: config.facebook.clientSecret,
callbackURL: config.facebook.callbackURL,
passReqToCallback: true
},
function(req, accessToken, refreshToken, profile, done) {
// No email in the following colsole.log
console.log(JSON.stringify(profile));
}));
Run Code Online (Sandbox Code Playgroud)
获得如下:
app.get('/oauth/facebook', passport.authenticate('facebook', {
failureRedirect: '/login',
scope:['email']
}));
Run Code Online (Sandbox Code Playgroud)
(所以我在这里说的使用范围:Passport-facebook没有收到电子邮件)
在FB-Login页面上iam甚至要求提供电子邮件,我确实提供了:
任何帮助都很贴切!
使用tidyverse
了很多我经常面临的挑战是将命名向量转换为data.frame
/ tibble
,其中列是向量的名称.
这样做的首选/ tidyverse方式是什么?
编辑:这与:这和这个 github问题有关
所以我想:
require(tidyverse)
vec <- c("a" = 1, "b" = 2)
Run Code Online (Sandbox Code Playgroud)
成为这个:
# A tibble: 1 × 2
a b
<dbl> <dbl>
1 1 2
Run Code Online (Sandbox Code Playgroud)
我可以通过例如:
vec %>% enframe %>% spread(name, value)
vec %>% t %>% as_tibble
Run Code Online (Sandbox Code Playgroud)
用例:
require(tidyverse)
require(rvest)
txt <- c('<node a="1" b="2"></node>',
'<node a="1" c="3"></node>')
txt %>% map(read_xml) %>% map(xml_attrs) %>% map_df(~t(.) %>% as_tibble)
Run Code Online (Sandbox Code Playgroud)
这使
# A tibble: 2 × 3
a b c …
Run Code Online (Sandbox Code Playgroud) 有没有ftp版本的list.files(path, recursive=TRUE)
?
我想在这个FTP-Server上的子目录中获取ZIP-Archieves的所有URL
url <- "ftp://ftp-cdc.dwd.de/pub/CDC/observations_germany/climate/hourly/"
Run Code Online (Sandbox Code Playgroud)
所以我想在这个目录中的所有文件的列表:
ftp://ftp-cdc.dwd.de/pub/CDC/observations_germany/climate/hourly/wind/recent/
以及
FTP:// FTP-CDC .dwd.de/pub/CDC/observation_germany/climate/hourly/air_temperature/historical /
等等
随着RCurl
我设法下载这个目录的dirlist但不要让所有子目录中的所有拉链archieves的完整列表.除了通过目录循环并逐个获取dirlists之外的任何建议?
RCurl代码到目前为止:
dwd_dirlist <- function(url, full = TRUE){
dir <- unlist(
strsplit(
getURL(url,
ftp.use.epsv = FALSE,
dirlistonly = TRUE),
"\n")
)
if(full) dir <- paste0(url, dir)
return(dir)
}
Run Code Online (Sandbox Code Playgroud) 如何用rmarkdown显示我的代码块的行号?
```{r}
x <- 1:10
y <- x^2
plot(x,y)
```
Run Code Online (Sandbox Code Playgroud)
我希望回声是这样的
1 x <- 1:10
2 y <- x^2
3 plot(x,y)
Run Code Online (Sandbox Code Playgroud)
最好像在Github上一样......
很高兴能得到任何帮助
我真的找不到任何使用x-ray和.driver(phantom())进行身份验证的例子.我已经通过x-ray和x-ray-phantom的文档进行了搜索但却找不到任何救命.
阅读这个优秀的帖子我遇到了within
和transform
.
阅读这两个帮助文件我不幸的是没有完全理解差异是什么......
我尝试过类似的东西:
df <- data.frame(A = runif(5), B = rnorm(5))
A=1:5
within(df, C<-A+B)
transform(df,C=A+B)
Run Code Online (Sandbox Code Playgroud)
两次输出都是:
A B C
1 0.2326266 1.3237210 1.5563476
2 0.4581693 -0.2605674 0.1976018
3 0.6431078 0.5920021 1.2351099
4 0.9682578 1.1964012 2.1646590
5 0.9889942 0.5468008 1.5357950
Run Code Online (Sandbox Code Playgroud)
所以两者似乎都在创造一种新的环境,因为他们A=1:5
在评估中忽略了这一点.
提前致谢!
到现在为止(10.7.2016),express-session的github-page建议了两个mongodb会话商店:
我应该选择哪一个,两者之间有什么区别?通过流行显然connect-mongo获胜,但它真的是"更好"的产品吗?为什么MongoDB本身很难用现有的解决方案编程connect-mongodb-session?
任何建议都适用.
PS:我注意到有几个(过时的)SO问题比较了存储的不同MongoDB支持的会话,但是(据我注意到)非比较这些推荐的两个.
是否存在与基本R 函数等效的字符串grep
?
我想要匹配的字符串的索引.例:
grep("F|Y", LETTERS)
[1] 6 25
Run Code Online (Sandbox Code Playgroud)
使用stringr我的解决方法将使用which
如下:
which(str_detect(LETTERS, "F|Y"))
[1] 6 25
Run Code Online (Sandbox Code Playgroud) 如何将托管策略附加到 lambda 函数?
我试过:
provider:
name: aws
role: arn:aws:iam::aws:policy/AmazonCognitoReadOnly
Run Code Online (Sandbox Code Playgroud)
但这导致了以下错误:
配置堆栈时发生错误:GaDashextractLambdaFunction - 检测到 1 个验证错误:“角色”处的值“arn:aws:iam::aws:policy/AmazonCognitoReadOnly”无法满足约束:成员必须满足正则表达式模式:arn:aws: iam::\d{12}:角色/?[a-zA-Z_0-9+=,.@-_/]+.
amazon-web-services amazon-iam amazon-cognito aws-lambda serverless-framework
r ×5
amazon-iam ×2
node.js ×2
aws-lambda ×1
dplyr ×1
express ×1
facebook ×1
ftp ×1
javascript ×1
mean-stack ×1
mongodb ×1
oauth ×1
passport.js ×1
phantomjs ×1
purrr ×1
r-markdown ×1
recursion ×1
stringr ×1
tidyr ×1
tidyverse ×1
web-scraping ×1
x-ray ×1