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

feat(auth): create system key #4235

Merged
merged 11 commits into from
Aug 15, 2024
Merged

feat(auth): create system key #4235

merged 11 commits into from
Aug 15, 2024

Conversation

mikeldking
Copy link
Contributor

@mikeldking mikeldking commented Aug 14, 2024

resolves #4234

This introduces create system API creation mutation. It is not wored up, is intended for scaffolding a working UI.

mutation {
  createSystemApiKey(input: { name: "system-api-key"}) {
    jwt
    apiKey {
      name
      description
      createdAt
      expiresAt
    }
  }
}

Payload

{
  "data": {
    "createSystemApiKey": {
      "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoic3lzdGVtLWFwaS1rZXkiLCJkZXNjcmlwdGlvbiI6bnVsbCwiaWF0IjoxNzIzNjg3NTI4LCJpZCI6OH0.29TOm3JM2aY5vdALWnNlLA7cJXM1r3UZu3ApiqfEhpg",
      "apiKey": {
        "name": "system-api-key",
        "description": null,
        "createdAt": "2024-08-15T02:05:28+00:00",
        "expiresAt": null
      }
    }
  }
}

@@ -61,6 +61,7 @@ dependencies = [
"arize-phoenix-evals>=0.13.1",
"fastapi",
"pydantic>=1.0,!=2.0.*,<3,", # exclude 2.0.* since it does not support the `json_encoders` configuration setting
"pyjwt",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@axiomofjoy not 100% sure on the authlib dependency yet and so just minimizing the dependencies for now. I think it's pretty interchangeable if needed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sg

@mikeldking mikeldking marked this pull request as ready for review August 15, 2024 02:11
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Aug 15, 2024
secret (Optional[str], optional): The application secret for auth. Defaults to None.

Returns:
GraphQLRouter: _description_
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed this part.

Comment on lines +25 to +27
class CreateApiKeyInput:
name: str
description: Optional[str] = UNSET
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll also need the expiry.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay I can add that. I wasn't sure if you wanted system keys to not expire for some reason

@mikeldking mikeldking merged commit bae5fbe into main Aug 15, 2024
12 checks passed
@mikeldking mikeldking deleted the 4234-system-api-key branch August 15, 2024 21:34
fjcasti1 added a commit that referenced this pull request Aug 16, 2024
* main: (58 commits)
  Update OpenAPI spec (#4260)
  Default to adding span annotations to queue (#4259)
  docs: Add human feedback notebook tutorial (#4257)
  refactor: daemon task abstraction (#4255)
  feat(auth): create system key (#4235)
  chore: add vision fixture (#4250)
  docs: fix variable name typo in run experiments doc (#4249)
  build(deps): bump certifi (#4147)
  chore(main): release arize-phoenix 4.24.0 (#4225)
  chore(main): release arize-phoenix-evals 0.15.0 (#3920)
  feat(experiments): ability to specify concurrency in run_experiment and evaluate_experiment (#4189)
  ci(evals): limit `mistralai` below version 1.0 (#4241)
  feat(auth): user / system api key resolvers (#4232)
  feat(auth): add user role, exclude system in user lists (#4229)
  docs: Add multimodal image reasoning tutorial with llama index (#4210)
  chore(main): release arize-phoenix 4.23.0 (#4216)
  docs: No subject (GITBOOK-818)
  build(deps): bump streamlit (#4214)
  fix: Propagate span annotation metadata to examples on all mutations (#4195)
  feat(auth): users table in settings (#4221)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[auth][graphql] createSystemAPIKey resolver
2 participants