зеркало из https://github.com/Azure/AzureAuth.git
add tests for changing resource
This commit is contained in:
Родитель
de82170782
Коммит
db02dd2f27
|
@ -134,3 +134,15 @@ test_that("Resource owner grant works",
|
|||
expect_true(is_azure_token(tok))
|
||||
})
|
||||
|
||||
|
||||
test_that("Refreshing with changed resource works",
|
||||
{
|
||||
res <- "https://management.azure.com/"
|
||||
|
||||
tok <- get_azure_token(res, tenant, cli_app)
|
||||
expect_identical(res, decode_jwt(tok)$payload$aud)
|
||||
|
||||
tok$resource <- "https://graph.microsoft.com/"
|
||||
tok$refresh()
|
||||
expect_identical("https://graph.microsoft.com/", decode_jwt(tok)$payload$aud)
|
||||
})
|
||||
|
|
|
@ -171,3 +171,17 @@ test_that("Resource owner grant works",
|
|||
expect_identical(resbase, decode_jwt(tok)$payload$aud)
|
||||
})
|
||||
|
||||
|
||||
test_that("Refreshing with changed resource works",
|
||||
{
|
||||
res <- "https://management.azure.com/.default"
|
||||
resbase <- "https://management.azure.com"
|
||||
res2 <- "offline_access"
|
||||
|
||||
tok <- get_azure_token(c(res, res2), tenant, cli_app, version=2)
|
||||
expect_identical(resbase, decode_jwt(tok)$payload$aud)
|
||||
|
||||
tok$scope[1] <- "https://graph.microsoft.com/.default"
|
||||
tok$refresh()
|
||||
expect_identical(decode_jwt(tok)$payload$aud, "https://graph.microsoft.com")
|
||||
})
|
||||
|
|
Загрузка…
Ссылка в новой задаче