Fakultas Ilmu Komputer UI

Commit 028b19cd authored by Annisa Devi Nurmalasari's avatar Annisa Devi Nurmalasari
Browse files

Merge branch 'annisa-grpc' into 'master'

Mengubah address

See merge request !2
parents 5e72b905 c3843481
Pipeline #134011 passed with stage
in 1 minute and 52 seconds
......@@ -6,5 +6,16 @@ Cara menjalankan program :
Keterangan :
<<<<<<< HEAD
<br/>Komunikasi Auth-Frontend : REST
<br/>Komunikasi Auth-Service Lain : gRPC
Link Server :
Komunikasi Auth-Frontend : REST
Komunikasi Auth-Service Lain : gRPC
>>>>>>> 5e72b905b59c430ea751f9765e7058dee6d248d2
......@@ -9,6 +9,8 @@ def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'auth_remindme.settings')
from django.core.management import execute_from_command_line
from django.core.management.commands.runserver import Command as runserver
runserver.default_addr = ""
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
import grpc
from oauth_proto import resource_pb2, resource_pb2_grpc
with grpc.insecure_channel('localhost:50051') as channel:
# Isi token dengan access token baru
with grpc.insecure_channel('') as channel:
stub = resource_pb2_grpc.ResourceServiceStub(channel)
print('----- GetResource -----')
response = stub.GetResource(resource_pb2.ResourceRequest(),
('authorization', 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjUzNTQwNTcyLCJpYXQiOjE2NTM1MzY5NzIsImp0aSI6IjRkMjE2MzViNDMyZTQ0MDA4OGFiODIwMjcyNjJkYjdjIiwidXNlcl9pZCI6MTd9.oKiKnOlJR6x2Pzpej-fTypYZ6juldtd4P-Kw8b1wDUs'),
('authorization', 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjUzNTc0MDcxLCJpYXQiOjE2NTM1NzA0NzEsImp0aSI6ImIzNGY1YTEwNjk3NTQzODg5NjVmZGI1MDIyZGIxZjZmIiwidXNlcl9pZCI6MX0.PtlrZHiTdDKdzN9MkjUkhVeQaUhbcooYaOaqtwZoz-Y'),
print(response, end='')
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment