Skip to content

Commit

Permalink
[Authz] Migrated authorized routes owned by @elastic/obs-ux-infra_ser…
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine committed Oct 29, 2024
1 parent c7b8ca0 commit f269ea7
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ export function registerTopNFunctionsAPMTransactionsRoute({
router.get(
{
path: paths.APMTransactions,
security: {
authz: {
requiredPrivileges: ['profiling', 'apm'],
},
},
options: {
tags: ['access:profiling', 'access:apm'],
timeout: { idleSocket: IDLE_SOCKET_TIMEOUT },
},
validate: { query: querySchema },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ export function registerFlameChartSearchRoute({
router.get(
{
path: paths.Flamechart,
options: { tags: ['access:profiling'], timeout: { idleSocket: IDLE_SOCKET_TIMEOUT } },
security: {
authz: {
requiredPrivileges: ['profiling'],
},
},
options: { timeout: { idleSocket: IDLE_SOCKET_TIMEOUT } },
validate: {
query: schema.object({
timeFrom: schema.number(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ export function registerTopNFunctionsSearchRoute({
router.get(
{
path: paths.TopNFunctions,
options: { tags: ['access:profiling'], timeout: { idleSocket: IDLE_SOCKET_TIMEOUT } },
security: {
authz: {
requiredPrivileges: ['profiling'],
},
},
options: { timeout: { idleSocket: IDLE_SOCKET_TIMEOUT } },
validate: { query: querySchema },
},
async (context, request, response) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ export function registerSetupRoute({
router.get(
{
path: paths.HasSetupESResources,
options: { tags: ['access:profiling'] },
security: {
authz: {
requiredPrivileges: ['profiling'],
},
},
validate: false,
},
async (context, request, response) => {
Expand Down Expand Up @@ -62,7 +66,11 @@ export function registerSetupRoute({
router.post(
{
path: paths.HasSetupESResources,
options: { tags: ['access:profiling'] },
security: {
authz: {
requiredPrivileges: ['profiling'],
},
},
validate: false,
},
async (context, request, response) => {
Expand Down Expand Up @@ -166,7 +174,11 @@ export function registerSetupRoute({
router.get(
{
path: paths.SetupDataCollectionInstructions,
options: { tags: ['access:profiling'] },
security: {
authz: {
requiredPrivileges: ['profiling'],
},
},
validate: false,
},
async (context, request, response) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ export function registerStorageExplorerRoute({
router.get(
{
path: paths.StorageExplorerSummary,
options: { tags: ['access:profiling'] },
security: {
authz: {
requiredPrivileges: ['profiling'],
},
},
validate: {
query: schema.object({
indexLifecyclePhase: schema.oneOf([
Expand Down Expand Up @@ -112,7 +116,11 @@ export function registerStorageExplorerRoute({
router.get(
{
path: paths.StorageExplorerHostStorageDetails,
options: { tags: ['access:profiling'] },
security: {
authz: {
requiredPrivileges: ['profiling'],
},
},
validate: {
query: schema.object({
indexLifecyclePhase: schema.oneOf([
Expand Down Expand Up @@ -156,7 +164,11 @@ export function registerStorageExplorerRoute({
router.get(
{
path: paths.StorageExplorerIndicesStorageDetails,
options: { tags: ['access:profiling'] },
security: {
authz: {
requiredPrivileges: ['profiling'],
},
},
validate: {
query: schema.object({
indexLifecyclePhase: schema.oneOf([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,12 @@ export function queryTopNCommon({
router.get(
{
path: pathName,
options: { tags: ['access:profiling'], timeout: { idleSocket: IDLE_SOCKET_TIMEOUT } },
security: {
authz: {
requiredPrivileges: ['profiling'],
},
},
options: { timeout: { idleSocket: IDLE_SOCKET_TIMEOUT } },
validate: {
query: schema.object({
timeFrom: schema.number(),
Expand Down

0 comments on commit f269ea7

Please sign in to comment.