Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Extensions] Create an interface that Job Scheduler can use to manage user info associated with a scheduled job #2626

Open
Tracked by #2528
cwperks opened this issue Mar 31, 2023 · 1 comment
Labels
triaged Issues labeled as 'Triaged' have been reviewed and are deemed actionable.

Comments

@cwperks
Copy link
Member

cwperks commented Mar 31, 2023

Job Scheduler is responsible for invoking scheduled jobs registered by plugins/extensions. In the new security model for extensions, user info is stored in a single secure index that is not owned by the respective plugin/extensions that create scheduled jobs. Job Scheduler needs to an interface to invoke methods to save user details, delete user details (when job is deleted) and another method to issue an access token to be used for job execution.

Some pseudo-code of a ScheduledJobIdentityManager:

/*
 * SPDX-License-Identifier: Apache-2.0
 *
 * The OpenSearch Contributors require contributions made to
 * this file be licensed under the Apache-2.0 license or a
 * compatible open source license.
 */

package org.opensearch.identity;

import org.opensearch.identity.tokens.AuthToken;

/**
 * An interface with methods used to provide security for scheduled jobs
 *
 * @opensearch.experimental
 */
public interface ScheduledJobIdentityManager {

    /**
     * Method implemented by an identity plugin to store user information for a scheduled job
     * @param jobId The id of the scheduled job
     * @param indexName The index where scheduled job details is stored
     */
    void saveUserDetails(String jobId, String indexName);

    /**
     * Method implemented by an identity plugin to delete user information for a scheduled job
     * @param jobId The id of the scheduled job
     * @param indexName The index where scheduled job details is stored
     */
    void deleteUserDetails(String jobId, String indexName);

    /**
     * Method implemented by an identity plugin to issue an access token for a scheduler job runner
     * @param jobId The id of the scheduled job
     * @param indexName The index where scheduled job details is stored
     */
    AuthToken issueAccessTokenOnBehalfOfUser(String jobId, String indexName);
}
@github-actions github-actions bot added the untriaged Require the attention of the repository maintainers and may need to be prioritized label Mar 31, 2023
@stephen-crawford stephen-crawford added triaged Issues labeled as 'Triaged' have been reviewed and are deemed actionable. and removed untriaged Require the attention of the repository maintainers and may need to be prioritized labels Apr 3, 2023
@stephen-crawford
Copy link
Contributor

[Triage] This is part of the Extensions project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged Issues labeled as 'Triaged' have been reviewed and are deemed actionable.
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

2 participants