Skip to content

feat: add API key namespace restriction, MODULE_FULL type and g… - #106

Open
markdjones82 wants to merge 10 commits into
MatthewJohn:mainfrom
markdjones82:feat/api-key-git-provider-ui
Open

feat: add API key namespace restriction, MODULE_FULL type and g…#106
markdjones82 wants to merge 10 commits into
MatthewJohn:mainfrom
markdjones82:feat/api-key-git-provider-ui

Conversation

@markdjones82

Copy link
Copy Markdown
Contributor

…it provider UI

  • Add optional namespace restriction to upload and publish API keys
  • Store matched DB-backed API key on Flask g during authentication
  • Add MODULE_FULL api key type granting both upload and publish permissions
  • Add namespace restriction field to API Keys UI
  • Add git provider management UI page
  • Add provider sources UI page
  • New alembic migrations for api_key table and namespace column

Addresses:
#102
#105

…it provider UI

- Add optional namespace restriction to upload and publish API keys
- Store matched DB-backed API key on Flask g during authentication
- Add MODULE_FULL api key type granting both upload and publish permissions
- Add namespace restriction field to API Keys UI
- Add git provider management UI page
- Add provider sources UI page
- New alembic migrations for api_key table and namespace column
Comment thread terrareg/templates/api_keys.html
Comment thread terrareg/templates/api_keys.html Outdated
Comment thread CHANGELOG.md Outdated
'post': [terrareg.auth_wrapper.auth_wrapper('is_admin')]
}

def _post_arg_parser(self):

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

With these changes to the API, there's a script scripts/generate_readme.py (badly named), which will update the API docs with the new endpoint specs :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I am getting module errors when trying to run the generate :/



class ApiTerraregGitProviders(ErrorCatchingResource):
"""Interface to obtain git provider configurations."""

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Could you update this to include both retrieving, create, modifying and deleting?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not sure what to change here, retrieve/create is handled by the collection class and modify/delete are in the item class. Were you thinking it be done a different way?

Comment thread terrareg/static/js/terrareg/provider_sources_page.js Outdated
Comment thread terrareg/alembic/versions/a1b2c3d4e5f6_add_namespace_to_api_key.py Outdated
Comment thread terrareg/auth/module_full_api_key_auth_method.py Outdated
Comment thread terrareg/auth/base_api_key_auth_method.py Outdated
Comment thread terrareg/auth/base_api_key_auth_method.py Outdated
@markdjones82
markdjones82 marked this pull request as draft May 23, 2026 21:00
@markdjones82
markdjones82 marked this pull request as ready for review May 24, 2026 20:06
@markdjones82

Copy link
Copy Markdown
Contributor Author

Ok, updated and ready for a re-review. Feel free to take it from here if you like. I think I've modified it as best as I understand what you are looking for!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants