Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
GhazanfarShahbaz committed Jun 20, 2024
1 parent b5dfe7a commit aa3121c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/token_granter_wrapper/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .token_granter_bindings import *
6 changes: 6 additions & 0 deletions src/token_granter_wrapper/token_granter.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class TokenGranter:
def __init__(self, token_granter_url: str) -> None: ...
def grant_access_token(
self, username: str, password: str, temporary: bool
) -> str: ...
def validate_token(self, username: str, token: str) -> bool: ...
16 changes: 16 additions & 0 deletions src/token_granter_wrapper/token_granter_bindings.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include "../../lib/include/token_granter.hpp"

// EXTERNAL IMPORTS START HERE
#include "../../lib/include/pybind11/include/pybind11/pybind11.h"
#include "../../lib/include/pybind11/include/pybind11/stl.h"
// EXTERNAL IMPORTS END HERE

namespace py = pybind11;

PYBIND11_MODULE(token_granter_bindings, m)
{
py::class_<TokenGranter>(m, "TokenGranter")
.def(py::init<const std::string &>())
.def("grant_access_token", &TokenGranter::grant_access_token)
.def("validate_token", &TokenGranter::validate_token);
}

0 comments on commit aa3121c

Please sign in to comment.